From a8c2fa28947960cce78d905ac9bbcb490ec78382 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 3 May 2019 15:04:46 +0200 Subject: Add config.{c,cxx}.std These values override {c,cxx}.std specified at the project level. In particular, this allows us to force a specific standard for all the projects in a build configuration, for example: b create: conf/,cc config.cxx=g++ config.cxx.std=experimental --- build2/cc/module.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'build2/cc/module.cxx') diff --git a/build2/cc/module.cxx b/build2/cc/module.cxx index 1e3806a..7527da2 100644 --- a/build2/cc/module.cxx +++ b/build2/cc/module.cxx @@ -286,9 +286,24 @@ namespace build2 const compiler_info& ci (*ci_); const target_triplet& tt (cast (rs[x_target])); - // Translate x_std value (if any) to the compiler option(s) (if any). + // config.x.std overrides x.std // - tstd = translate_std (ci, rs, cast_null (rs[x_std])); + { + lookup l (config::omitted (rs, config_x_std).first); + + const string* v; + if (l.defined ()) + { + v = cast_null (l); + rs.assign (x_std) = v; + } + else + v = cast_null (rs[x_std]); + + // Translate x_std value (if any) to the compiler option(s) (if any). + // + tstd = translate_std (ci, rs, v); + } // Extract system header/library search paths from the compiler and // determine if we need any additional search paths. -- cgit v1.1