diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-08 12:46:10 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-08 12:46:10 +0200 |
commit | 8b07d68462c5fec92fd5a4aab77ddfd425d1f8d0 (patch) | |
tree | 155b5d4e1789bdb2523081da12201d87d5fa4153 /build2/cc/module.cxx | |
parent | f6c3788de3d148c90aba705d045b1d92e7fea20a (diff) |
Implement compiler_info caching
Diffstat (limited to 'build2/cc/module.cxx')
-rw-r--r-- | build2/cc/module.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
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<path> (*p.first)); - ci = build2::cc::guess (x_lang, - xc, - cast_null<strings> (rs[config_c_poptions]), - cast_null<strings> (rs[config_x_poptions]), - cast_null<strings> (rs[config_c_coptions]), - cast_null<strings> (rs[config_x_coptions]), - cast_null<strings> (rs[config_c_loptions]), - cast_null<strings> (rs[config_x_loptions])); + ci_ = &build2::cc::guess (x_lang, + xc, + cast_null<strings> (rs[config_c_poptions]), + cast_null<strings> (rs[config_x_poptions]), + cast_null<strings> (rs[config_c_coptions]), + cast_null<strings> (rs[config_x_coptions]), + cast_null<strings> (rs[config_c_loptions]), + cast_null<strings> (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<target_triplet> (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); } |