aboutsummaryrefslogtreecommitdiff
path: root/build/config
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-03-24 08:53:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-03-24 08:53:06 +0200
commita94dcda7f00b10cb22b5f2138b1c29bcfbe7de37 (patch)
treec4ca2c4b2ea08285774569283120233a03aa2cb3 /build/config
parenteaaa82bd9c1e24a83dcea3857f5fd75d0dfb6de5 (diff)
Make meta-operations control build loop; add disfigure skeleton
Diffstat (limited to 'build/config')
-rw-r--r--build/config/module2
-rw-r--r--build/config/module.cxx12
-rw-r--r--build/config/operation.cxx56
3 files changed, 62 insertions, 8 deletions
diff --git a/build/config/module b/build/config/module
index 5a9d362..c7921df 100644
--- a/build/config/module
+++ b/build/config/module
@@ -12,7 +12,7 @@ namespace build
namespace config
{
void
- load (scope&, scope&, const location&);
+ init (scope&, scope&, const location&);
}
}
diff --git a/build/config/module.cxx b/build/config/module.cxx
index b184286..dca6ede 100644
--- a/build/config/module.cxx
+++ b/build/config/module.cxx
@@ -26,24 +26,24 @@ namespace build
}
void
- load (scope& root, scope& base, const location& l)
+ init (scope& root, scope& base, const location& l)
{
- tracer trace ("config::load");
+ tracer trace ("config::init");
- //@@ TODO: avoid multiple loads (generally, for modules).
+ //@@ TODO: avoid multiple inits (generally, for modules).
//
level4 ([&]{trace << "for " << root.path () << '/';});
if (&root != &base)
- fail (l) << "config module must be loaded in project root scope";
+ fail (l) << "config module must be initialized in project root scope";
// Register meta-operations.
//
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";
+ fail (l) << "config module must be initialized before other modules";
- // Register the build/config.build loading trigger.
+ // Register the build/config.build sourcing trigger.
//
root.triggers[path ("build/config.build")] = &trigger;
}
diff --git a/build/config/operation.cxx b/build/config/operation.cxx
index c004a0d..1411ce4 100644
--- a/build/config/operation.cxx
+++ b/build/config/operation.cxx
@@ -4,6 +4,8 @@
#include <build/config/operation>
+#include <build/diagnostics>
+
using namespace std;
namespace build
@@ -11,6 +13,58 @@ namespace build
namespace config
{
meta_operation_info configure {"configure"};
- meta_operation_info disfigure {"disfigure"};
+
+ // disfigure
+ //
+ static operation_id
+ disfigure_operation_pre (operation_id o)
+ {
+ return o; // Don't translate default to update.
+ }
+
+ static void
+ disfigure_load (const path& bf,
+ scope&,
+ const path&,
+ const path&,
+ const location&)
+ {
+ tracer trace ("disfigure_load");
+ level4 ([&]{trace << "skipping " << bf;});
+ }
+
+ static void
+ disfigure_match (action a,
+ const target_key& tk,
+ const location& l,
+ action_targets& ts)
+ {
+ tracer trace ("disfigure_match");
+ //level4 ([&]{trace << "matching " << t;});
+ //ts.push_back (&t);
+ }
+
+ static void
+ disfigure_execute (action a, const action_targets& ts)
+ {
+ tracer trace ("execute");
+
+
+ for (void* v: ts)
+ {
+ //level4 ([&]{trace << "disfiguring target " << t;});
+ }
+ }
+
+ meta_operation_info disfigure {
+ "disfigure",
+ nullptr, // meta-operation pre
+ &disfigure_operation_pre,
+ &disfigure_load,
+ &disfigure_match,
+ &disfigure_execute,
+ nullptr, // operation post
+ nullptr // meta-operation post
+ };
}
}