diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-07 09:18:22 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-07 09:18:22 +0200 |
commit | 49d5628e35593a5300d39596286c768d7aa435b6 (patch) | |
tree | 43f20983a381c54aac7536e78e4f9543d8761aac /build/config/module.cxx | |
parent | 16c19b739a58845af7f807c3dee8021a1c421006 (diff) |
Rework module architecture
Now the target type and rule maps are in scopes (builtins -- in global
scope). We also now have the map of loaded modules in the root scope of
each project.
Diffstat (limited to 'build/config/module.cxx')
-rw-r--r-- | build/config/module.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/build/config/module.cxx b/build/config/module.cxx index 7ac9071..237547c 100644 --- a/build/config/module.cxx +++ b/build/config/module.cxx @@ -23,16 +23,23 @@ namespace build // static const path config_file ("build/config.build"); - void - init (scope& root, scope& base, const location& l) + extern "C" void + config_init (scope& root, + scope& base, + const location& l, + std::unique_ptr<module>&, + bool first) { - //@@ TODO: avoid multiple inits (generally, for modules). - // - tracer trace ("config::init"); if (&root != &base) - fail (l) << "config module must be initialized in project root scope"; + fail (l) << "config module must be initialized in bootstrap.build"; + + if (!first) + { + warn (l) << "multiple config module initializations"; + return; + } const dir_path& out_root (root.path ()); level4 ([&]{trace << "for " << out_root;}); |