From 76de594667b370094f5da5c0871c155d788d135e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Jan 2018 15:35:57 +0200 Subject: Initial support for c/cxx runtime/stdlib detection --- build2/cc/init.cxx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'build2/cc/init.cxx') diff --git a/build2/cc/init.cxx b/build2/cc/init.cxx index b49de15..258e071 100644 --- a/build2/cc/init.cxx +++ b/build2/cc/init.cxx @@ -100,6 +100,11 @@ namespace build2 v.insert ("config.cc.pattern"); v.insert ("config.cc.target"); + // Compiler runtime and C standard library. + // + v.insert ("cc.runtime"); + v.insert ("cc.stdlib"); + // Target type, for example, "C library" or "C++ library". Should be set // on the target by the matching rule to the name of the module (e.g., // "c", "cxx"). Currenly only set for libraries and is used to decide @@ -145,7 +150,7 @@ namespace build2 unique_ptr&, bool first, bool, - const variable_map& hints) + const variable_map& h) { tracer trace ("cc::core_guess_init"); l5 ([&]{trace << "for " << rs.out_path ();}); @@ -162,9 +167,8 @@ namespace build2 { // These values must be hinted. // - rs.assign ("cc.id") = cast (hints["config.cc.id"]); - rs.assign ("cc.hinter") = - cast (hints["config.cc.hinter"]); + rs.assign ("cc.id") = cast (h["config.cc.id"]); + rs.assign ("cc.hinter") = cast (h["config.cc.hinter"]); } // config.cc.target @@ -172,7 +176,7 @@ namespace build2 { // This value must be hinted. // - const auto& t (cast (hints["config.cc.target"])); + const auto& t (cast (h["config.cc.target"])); // Also enter as cc.target.{cpu,vendor,system,version,class} for // convenience of access. @@ -192,9 +196,15 @@ namespace build2 // This value could be hinted. // rs.assign ("cc.pattern") = - cast_empty (hints["config.cc.pattern"]); + cast_empty (h["config.cc.pattern"]); } + // cc.runtime + // cc.stdlib + // + rs.assign ("cc.runtime") = cast (h["cc.runtime"]); + rs.assign ("cc.stdlib") = cast (h["cc.stdlib"]); + return true; } -- cgit v1.1