diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-08-14 15:48:34 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-08-14 15:48:34 +0200 |
commit | 47bf5cd6a167730ee06a1c7cffeae6540f67dde0 (patch) | |
tree | 7c9c07d33b41be75d1a5d6ec40c153beda2a2a19 /build/config | |
parent | f62ff2e840fd92a03b4a3298de938d426f8b5c7a (diff) |
Rework meta/operation registration
We now have global tables for meta/operation. Plus each can
then be enabled on the per-project basis.
Diffstat (limited to 'build/config')
-rw-r--r-- | build/config/module.cxx | 15 | ||||
-rw-r--r-- | build/config/operation | 3 |
2 files changed, 7 insertions, 11 deletions
diff --git a/build/config/module.cxx b/build/config/module.cxx index 237547c..fbb51af 100644 --- a/build/config/module.cxx +++ b/build/config/module.cxx @@ -24,15 +24,15 @@ namespace build static const path config_file ("build/config.build"); extern "C" void - config_init (scope& root, - scope& base, + config_init (scope& r, + scope& b, const location& l, std::unique_ptr<module>&, bool first) { tracer trace ("config::init"); - if (&root != &base) + if (&r != &b) fail (l) << "config module must be initialized in bootstrap.build"; if (!first) @@ -41,21 +41,20 @@ namespace build return; } - const dir_path& out_root (root.path ()); + const dir_path& out_root (r.path ()); level4 ([&]{trace << "for " << out_root;}); // Register meta-operations. // - if (root.meta_operations.insert (configure) != configure_id || - root.meta_operations.insert (disfigure) != disfigure_id) - fail (l) << "config module must be initialized before other modules"; + r.meta_operations.insert (configure_id, configure); + r.meta_operations.insert (disfigure_id, disfigure); // Load config.build if one exists. // path f (out_root / config_file); if (file_exists (f)) - source (f, root, root); + source (f, r, r); } } } diff --git a/build/config/operation b/build/config/operation index 514c118..ee5161d 100644 --- a/build/config/operation +++ b/build/config/operation @@ -11,9 +11,6 @@ namespace build { namespace config { - const meta_operation_id configure_id = 2; - const meta_operation_id disfigure_id = 3; - extern meta_operation_info configure; extern meta_operation_info disfigure; } |