diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-12 16:23:37 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-12 17:04:22 +0200 |
commit | 83b5af87efef571b707fc1f409f22571a9f5054c (patch) | |
tree | 4961218154dbe2237f017b9e068ffe80fa025ed7 /build2/cc | |
parent | 0fd7815cbc6557811df4f1b6ffb40461474b8534 (diff) |
Add support for ordering modules in config.build
Diffstat (limited to 'build2/cc')
-rw-r--r-- | build2/cc/init.cxx | 4 | ||||
-rw-r--r-- | build2/cc/module.cxx | 19 |
2 files changed, 22 insertions, 1 deletions
diff --git a/build2/cc/init.cxx b/build2/cc/init.cxx index 80e5027..5f8e2fb 100644 --- a/build2/cc/init.cxx +++ b/build2/cc/init.cxx @@ -87,6 +87,10 @@ namespace build2 // if (first) { + // Adjust module priority (compiler). + // + config::save_module (r, "cc", 250); + // config.cc.id // { diff --git a/build2/cc/module.cxx b/build2/cc/module.cxx index 4b51905..74c07e2 100644 --- a/build2/cc/module.cxx +++ b/build2/cc/module.cxx @@ -43,6 +43,15 @@ namespace build2 if (first) { + // Adjust module priority (compiler). Also order cc module before us + // (we don't want to use priorities for that in case someone manages + // to slot in-between). + // + if (!cc_loaded) + config::save_module (r, "cc", 250); + + config::save_module (r, x, 250); + const variable& config_c_coptions (var_pool["config.cc.coptions"]); // config.x @@ -66,7 +75,15 @@ namespace build2 cast_null<string> (r["cc.pattern"])) : path (x_default)); - auto p1 (config::required (r, config_x, d)); + // If this value was hinted, save it as commented out so that if the + // user changes the source of the pattern, this one will get updated + // as well. + // + auto p1 (config::required (r, + config_x, + d, + false, + cc_loaded ? config::save_commented : 0)); p.first = &p1.first.get (); p.second = p1.second; } |