From 398134d2b4d362f857de5d2c94942e919d0bc534 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 4 Dec 2017 12:41:32 +0200 Subject: Implement better cross-hinting between c-family modules --- build2/cc/init.cxx | 52 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 15 deletions(-) (limited to 'build2/cc/init.cxx') 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&, - bool first, - bool, - const variable_map& hints) + core_guess_init (scope& rs, + scope&, + const location& loc, + unique_ptr&, + 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 (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 ("cc.pattern") = cast (l); } + return true; + } + + bool + core_config_init (scope& rs, + scope&, + const location& loc, + unique_ptr&, + 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 (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. -- cgit v1.1