aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-01-21 15:02:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-01-21 15:02:32 +0200
commit41f091f46b47c20dc1571db5d56a1eaade25cb1e (patch)
tree529c31c040c0b631823d705d6bc5fdf6ca3cfce9
parent075404d03607048609a6f1b226d8e2845806b838 (diff)
Enter dist module variables in boot() rather than init()
-rw-r--r--build2/dist/module.cxx44
1 files changed, 22 insertions, 22 deletions
diff --git a/build2/dist/module.cxx b/build2/dist/module.cxx
index 893109a..6dd1453 100644
--- a/build2/dist/module.cxx
+++ b/build2/dist/module.cxx
@@ -32,30 +32,10 @@ namespace build2
// Register meta-operation.
//
r.meta_operations.insert (dist_id, dist);
- }
-
- extern "C" bool
- dist_init (scope& r,
- scope&,
- const location& l,
- unique_ptr<module>&,
- bool first,
- bool)
- {
- tracer trace ("dist::init");
-
- if (!first)
- {
- warn (l) << "multiple dist module initializations";
- return true;
- }
-
- const dir_path& out_root (r.out_path ());
- level5 ([&]{trace << "for " << out_root;});
- // Enter module variables.
+ // Enter module variables. Do it during boot in case they get assigned
+ // in bootstrap.build (which is customary for, e.g., dist.package).
//
- if (first)
{
auto& v (var_pool);
@@ -74,6 +54,26 @@ namespace build2
v.find ("dist.archives", strings_type);
v.find ("config.dist.archives", strings_type);
}
+ }
+
+ extern "C" bool
+ dist_init (scope& r,
+ scope&,
+ const location& l,
+ unique_ptr<module>&,
+ bool first,
+ bool)
+ {
+ tracer trace ("dist::init");
+
+ if (!first)
+ {
+ warn (l) << "multiple dist module initializations";
+ return true;
+ }
+
+ const dir_path& out_root (r.out_path ());
+ level5 ([&]{trace << "for " << out_root;});
// Register our wildcard rule. Do it explicitly for the alias
// to prevent something like insert<target>(dist_id, test_id)