From 296575ba025ded840304c1e3b6365a6b6ee7ea48 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Oct 2018 19:07:42 +0200 Subject: Add config.{c,cxx}.{id,version,target} configuration variables These variables allow overriding guessed compiler id/version/target, for example, in case of mis-guesses or when working with compilers that don't report their base (e.g., GCC, Clang) with -v/--version (common in the embedded space). --- build2/cc/module.cxx | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'build2/cc/module.cxx') diff --git a/build2/cc/module.cxx b/build2/cc/module.cxx index 363f1d0..5ef1f2a 100644 --- a/build2/cc/module.cxx +++ b/build2/cc/module.cxx @@ -115,16 +115,20 @@ namespace build2 // Figure out which compiler we are dealing with, its target, etc. // - const path& xc (cast (*p.first)); - ci_ = &build2::cc::guess (x_lang, - config_x.name, - xc, - cast_null (rs[config_c_poptions]), - cast_null (rs[config_x_poptions]), - cast_null (rs[config_c_coptions]), - cast_null (rs[config_x_coptions]), - cast_null (rs[config_c_loptions]), - cast_null (rs[config_x_loptions])); + ci_ = &build2::cc::guess ( + x, + x_lang, + cast (*p.first), + cast_null (config::omitted (rs, config_x_id).first), + cast_null (config::omitted (rs, config_x_version).first), + cast_null (config::omitted (rs, config_x_target).first), + cast_null (rs[config_c_poptions]), + cast_null (rs[config_x_poptions]), + cast_null (rs[config_c_coptions]), + cast_null (rs[config_x_coptions]), + cast_null (rs[config_c_loptions]), + cast_null (rs[config_x_loptions])); + const compiler_info& ci (*ci_); // Split/canonicalize the target. First see if the user asked us to @@ -139,7 +143,7 @@ namespace build2 ct = run (3, ops.config_sub (), ci.target.c_str (), - [] (string& l) {return move (l);}); + [] (string& l, bool) {return move (l);}); l5 ([&]{trace << "config.sub target: '" << ct << "'";}); } -- cgit v1.1