diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-10 13:54:59 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-10 13:54:59 +0200 |
commit | 0d0d9a9c56822919e9794658d31db57f8fc3e2bf (patch) | |
tree | 6dcb1649706dc7fc3f02cd5646b4611b3309fbd1 /build/dist | |
parent | 5f29fc16fb85a934280e00e54bc6307685c4e05d (diff) |
Implement two-phase initialization of modules loaded from bootstrap.build
Diffstat (limited to 'build/dist')
-rw-r--r-- | build/dist/module | 3 | ||||
-rw-r--r-- | build/dist/module.cxx | 21 |
2 files changed, 16 insertions, 8 deletions
diff --git a/build/dist/module b/build/dist/module index 20082ec..f2e024a 100644 --- a/build/dist/module +++ b/build/dist/module @@ -14,6 +14,9 @@ namespace build { namespace dist { + extern "C" void + dist_boot (scope&, const location&, unique_ptr<module>&); + extern "C" bool dist_init ( scope&, scope&, const location&, unique_ptr<module>&, bool, bool); diff --git a/build/dist/module.cxx b/build/dist/module.cxx index f0a446b..f39ef18 100644 --- a/build/dist/module.cxx +++ b/build/dist/module.cxx @@ -22,9 +22,21 @@ namespace build { static rule rule_; + extern "C" void + dist_boot (scope& r, const location&, unique_ptr<module>&) + { + tracer trace ("dist::boot"); + + level5 ([&]{trace << "for " << r.out_path ();}); + + // Register meta-operation. + // + r.meta_operations.insert (dist_id, dist); + } + extern "C" bool dist_init (scope& r, - scope& b, + scope&, const location& l, unique_ptr<module>&, bool first, @@ -32,9 +44,6 @@ namespace build { tracer trace ("dist::init"); - if (&r != &b) - fail (l) << "dist module must be initialized in bootstrap.build"; - if (!first) { warn (l) << "multiple dist module initializations"; @@ -66,10 +75,6 @@ namespace build v.find ("config.dist.archives", strings_type); } - // Register meta-operation. - // - r.meta_operations.insert (dist_id, dist); - // Register our wildcard rule. Do it explicitly for the alias // to prevent something like insert<target>(dist_id, test_id) // taking precedence. |