aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/dist/init.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-11-30 09:08:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-11-30 09:08:53 +0200
commit3bbbe09e8629ab5311a1bcbb9f56aa6a33e36f55 (patch)
treef3f6ab4fc633d98ae5a215ba4529b07849ba6792 /libbuild2/dist/init.cxx
parentd593b19735eec451b091fd46e4cb066e3478d6c9 (diff)
Deal with order dependence in dist rule
Diffstat (limited to 'libbuild2/dist/init.cxx')
-rw-r--r--libbuild2/dist/init.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/libbuild2/dist/init.cxx b/libbuild2/dist/init.cxx
index 26ff86d..9de84ce 100644
--- a/libbuild2/dist/init.cxx
+++ b/libbuild2/dist/init.cxx
@@ -21,8 +21,6 @@ namespace build2
{
namespace dist
{
- static const rule rule_;
-
void
boot (scope& rs, const location&, module_boot_extra& extra)
{
@@ -196,7 +194,7 @@ namespace build2
const location& l,
bool first,
bool,
- module_init_extra&)
+ module_init_extra& extra)
{
tracer trace ("dist::init");
@@ -208,13 +206,19 @@ namespace build2
l5 ([&]{trace << "for " << rs;});
+ module& mod (extra.module_as<module> ());
+
auto& vp (rs.var_pool (true /* public */)); // All qualified.
// Register our wildcard rule. Do it explicitly for the alias to prevent
// something like insert<target>(dist_id, test_id) taking precedence.
//
- rs.insert_rule<target> (dist_id, 0, "dist", rule_);
- rs.insert_rule<alias> (dist_id, 0, "dist.alias", rule_);
+ {
+ const rule& r (mod);
+
+ rs.insert_rule<target> (dist_id, 0, "dist", r);
+ rs.insert_rule<alias> (dist_id, 0, "dist.alias", r);
+ }
// We need this rule for out-of-any-project dependencies (for example,
// executables imported from /usr/bin, etc). We are registering it on