diff options
Diffstat (limited to 'build/config')
-rw-r--r-- | build/config/module.cxx | 12 | ||||
-rw-r--r-- | build/config/operation | 5 | ||||
-rw-r--r-- | build/config/operation.cxx | 2 |
3 files changed, 17 insertions, 2 deletions
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 <build/scope> #include <build/diagnostics> +#include <build/config/operation> + 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"}; } } |