From eaaa82bd9c1e24a83dcea3857f5fd75d0dfb6de5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Mar 2015 13:21:18 +0200 Subject: New consolidated load/match/build loop --- build/config/module.cxx | 12 ++++++++++-- build/config/operation | 5 +++++ build/config/operation.cxx | 2 ++ 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'build/config') diff --git a/build/config/module.cxx b/build/config/module.cxx index bbaccdc..b184286 100644 --- a/build/config/module.cxx +++ b/build/config/module.cxx @@ -8,6 +8,8 @@ #include #include +#include + using namespace std; namespace build @@ -28,12 +30,18 @@ namespace build { tracer trace ("config::load"); + //@@ TODO: avoid multiple loads (generally, for modules). + // + level4 ([&]{trace << "for " << root.path () << '/';}); + if (&root != &base) fail (l) << "config module must be loaded in project root scope"; - //@@ TODO: avoid multiple loads (generally, for modules). + // Register meta-operations. // - level4 ([&]{trace << "for " << root.path () << '/';}); + if (root.meta_operations.insert (configure) != configure_id || + root.meta_operations.insert (disfigure) != disfigure_id) + fail (l) << "config module must be loaded before other modules"; // Register the build/config.build loading trigger. // diff --git a/build/config/operation b/build/config/operation index a233e63..cfd04c3 100644 --- a/build/config/operation +++ b/build/config/operation @@ -11,6 +11,11 @@ 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; } } diff --git a/build/config/operation.cxx b/build/config/operation.cxx index cc04929..c004a0d 100644 --- a/build/config/operation.cxx +++ b/build/config/operation.cxx @@ -10,5 +10,7 @@ namespace build { namespace config { + meta_operation_info configure {"configure"}; + meta_operation_info disfigure {"disfigure"}; } } -- cgit v1.1