From 8b07d68462c5fec92fd5a4aab77ddfd425d1f8d0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Jan 2018 12:46:10 +0200 Subject: Implement compiler_info caching --- build2/cc/module.cxx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'build2/cc/module.cxx') diff --git a/build2/cc/module.cxx b/build2/cc/module.cxx index 1020bd6..c56bca9 100644 --- a/build2/cc/module.cxx +++ b/build2/cc/module.cxx @@ -107,14 +107,15 @@ 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, - 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_lang, + 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])); + const compiler_info& ci (*ci_); // Split/canonicalize the target. First see if the user asked us to // use config.sub. @@ -262,6 +263,7 @@ namespace build2 { tracer trace (x, "config_init"); + 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). @@ -398,12 +400,12 @@ namespace build2 } } - rs.assign (x_path) = move (ci.path); + rs.assign (x_path) = process_path (ci.path, false /* init */); rs.assign (x_sys_lib_dirs) = move (lib_dirs); rs.assign (x_sys_inc_dirs) = move (inc_dirs); - rs.assign (x_signature) = move (ci.signature); - rs.assign (x_checksum) = move (ci.checksum); + rs.assign (x_signature) = ci.signature; + rs.assign (x_checksum) = ci.checksum; // config.x.{p,c,l}options // config.x.libs @@ -440,7 +442,7 @@ namespace build2 variable_map h; if (!ci.bin_pattern.empty ()) - h.assign ("config.bin.pattern") = move (ci.bin_pattern); + h.assign ("config.bin.pattern") = ci.bin_pattern; load_module (rs, rs, "cc.core.config", loc, false, h); } -- cgit v1.1