From 41f091f46b47c20dc1571db5d56a1eaade25cb1e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 21 Jan 2016 15:02:32 +0200 Subject: Enter dist module variables in boot() rather than init() --- build2/dist/module.cxx | 44 ++++++++++++++++++++++---------------------- 1 file 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&, - 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&, + 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(dist_id, test_id) -- cgit v1.1