diff options
Diffstat (limited to 'libbuild2/cc')
-rw-r--r-- | libbuild2/cc/common.hxx | 2 | ||||
-rw-r--r-- | libbuild2/cc/init.cxx | 16 | ||||
-rw-r--r-- | libbuild2/cc/module.cxx | 8 |
3 files changed, 17 insertions, 9 deletions
diff --git a/libbuild2/cc/common.hxx b/libbuild2/cc/common.hxx index 781fcf5..bf971ab 100644 --- a/libbuild2/cc/common.hxx +++ b/libbuild2/cc/common.hxx @@ -56,6 +56,8 @@ namespace build2 const variable& x_path; // Compiler process path. const variable& x_mode; // Compiler mode options. + const variable& x_c_path; // Compiler path as configured. + const variable& x_c_mode; // Compiler mode as configured. const variable& x_sys_lib_dirs; // System library search directories. const variable& x_sys_inc_dirs; // System header search directories. diff --git a/libbuild2/cc/init.cxx b/libbuild2/cc/init.cxx index 040df7f..6791190 100644 --- a/libbuild2/cc/init.cxx +++ b/libbuild2/cc/init.cxx @@ -185,18 +185,18 @@ namespace build2 // config.cc.{id,hinter} // + // These values must be hinted. + // { - // These values must be hinted. - // rs.assign<string> ("cc.id") = cast<string> (h["config.cc.id"]); rs.assign<string> ("cc.hinter") = cast<string> (h["config.cc.hinter"]); } // config.cc.target // + // This value must be hinted. + // { - // This value must be hinted. - // const auto& t (cast<target_triplet> (h["config.cc.target"])); // Also enter as cc.target.{cpu,vendor,system,version,class} for @@ -213,18 +213,18 @@ namespace build2 // config.cc.pattern // + // This value could be hinted. Note that the hints may not be the same. + // { - // This value could be hinted. - // rs.assign<string> ("cc.pattern") = cast_empty<string> (h["config.cc.pattern"]); } // config.cc.mode // + // This value could be hinted. Note that the hints may not be the same. + // { - // This value could be hinted. - // rs.assign<strings> ("cc.mode") = cast_empty<strings> (h["config.cc.mode"]); } diff --git a/libbuild2/cc/module.cxx b/libbuild2/cc/module.cxx index eed2510..1aa1e01 100644 --- a/libbuild2/cc/module.cxx +++ b/libbuild2/cc/module.cxx @@ -140,11 +140,17 @@ namespace build2 mode.assign (++v.begin (), v.end ()); + // Save original path/mode in *.config.path/mode. + // + rs.assign (x_c_path) = xc; + rs.assign (x_c_mode) = mode; + // Figure out which compiler we are dealing with, its target, etc. // // Note that we could allow guess() to modify mode to support // imaginary options (such as /MACHINE for cl.exe). Though it's not - // clear what cc.mode would contain (original or modified). + // clear what cc.mode would contain (original or modified). Note that + // we are now folding *.std options into mode options. // x_info = &build2::cc::guess ( x, x_lang, move (xc), |