aboutsummaryrefslogtreecommitdiff
path: root/build/config
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-03-20 13:21:18 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-03-20 13:21:18 +0200
commiteaaa82bd9c1e24a83dcea3857f5fd75d0dfb6de5 (patch)
tree9d849682e5c8fb971382843064ea0c286d753cba /build/config
parentb6e72877a1a26a6ae16961728ee57e45f657f717 (diff)
New consolidated load/match/build loop
Diffstat (limited to 'build/config')
-rw-r--r--build/config/module.cxx12
-rw-r--r--build/config/operation5
-rw-r--r--build/config/operation.cxx2
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"};
}
}