aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-12 16:23:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-12 17:04:22 +0200
commit83b5af87efef571b707fc1f409f22571a9f5054c (patch)
tree4961218154dbe2237f017b9e068ffe80fa025ed7 /build2/cc/module.cxx
parent0fd7815cbc6557811df4f1b6ffb40461474b8534 (diff)
Add support for ordering modules in config.build
Diffstat (limited to 'build2/cc/module.cxx')
-rw-r--r--build2/cc/module.cxx19
1 files changed, 18 insertions, 1 deletions
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;
}