From 47bf5cd6a167730ee06a1c7cffeae6540f67dde0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 14 Aug 2015 15:48:34 +0200 Subject: Rework meta/operation registration We now have global tables for meta/operation. Plus each can then be enabled on the per-project basis. --- build/config/module.cxx | 15 +++++++-------- build/config/operation | 3 --- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'build/config') 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&, 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; } -- cgit v1.1