aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/init.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-04 12:41:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-04 12:41:32 +0200
commit398134d2b4d362f857de5d2c94942e919d0bc534 (patch)
tree03c5e1ce206a477fe41d344dae51b48aee73666b /build2/cc/init.cxx
parent2c8294b069f5df30d281e0f4f580f6f313a50eb2 (diff)
Implement better cross-hinting between c-family modules
Diffstat (limited to 'build2/cc/init.cxx')
-rw-r--r--build2/cc/init.cxx52
1 files changed, 37 insertions, 15 deletions
diff --git a/build2/cc/init.cxx b/build2/cc/init.cxx
index 3108d6d..90821ae 100644
--- a/build2/cc/init.cxx
+++ b/build2/cc/init.cxx
@@ -138,15 +138,15 @@ namespace build2
}
bool
- core_config_init (scope& rs,
- scope&,
- const location& loc,
- unique_ptr<module_base>&,
- bool first,
- bool,
- const variable_map& hints)
+ core_guess_init (scope& rs,
+ scope&,
+ const location& loc,
+ unique_ptr<module_base>&,
+ bool first,
+ bool,
+ const variable_map& hints)
{
- tracer trace ("cc::core_config_init");
+ tracer trace ("cc::core_guess_init");
l5 ([&]{trace << "for " << rs.out_path ();});
assert (first);
@@ -156,13 +156,6 @@ namespace build2
if (!cast_false<bool> (rs["cc.core.vars.loaded"]))
load_module (rs, rs, "cc.core.vars", loc);
- // Configure.
- //
-
- // Adjust module priority (compiler).
- //
- config::save_module (rs, "cc", 250);
-
// config.cc.id
//
{
@@ -199,6 +192,35 @@ namespace build2
rs.assign<string> ("cc.pattern") = cast<string> (l);
}
+ return true;
+ }
+
+ bool
+ core_config_init (scope& rs,
+ scope&,
+ const location& loc,
+ unique_ptr<module_base>&,
+ bool first,
+ bool,
+ const variable_map& hints)
+ {
+ tracer trace ("cc::core_config_init");
+ l5 ([&]{trace << "for " << rs.out_path ();});
+
+ assert (first);
+
+ // Load cc.core.guess.
+ //
+ if (!cast_false<bool> (rs["cc.core.guess.loaded"]))
+ load_module (rs, rs, "cc.core.guess", loc);
+
+ // Configure.
+ //
+
+ // Adjust module priority (compiler).
+ //
+ config::save_module (rs, "cc", 250);
+
// Note that we are not having a config report since it will just
// duplicate what has already been printed by the hinting module.