aboutsummaryrefslogtreecommitdiff
path: root/build/config
diff options
context:
space:
mode:
Diffstat (limited to 'build/config')
-rw-r--r--build/config/module19
-rw-r--r--build/config/module.cxx43
-rw-r--r--build/config/operation17
-rw-r--r--build/config/operation.cxx14
4 files changed, 93 insertions, 0 deletions
diff --git a/build/config/module b/build/config/module
new file mode 100644
index 0000000..5a9d362
--- /dev/null
+++ b/build/config/module
@@ -0,0 +1,19 @@
+// file : build/config/module -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BUILD_CONFIG_MODULE
+#define BUILD_CONFIG_MODULE
+
+#include <build/module>
+
+namespace build
+{
+ namespace config
+ {
+ void
+ load (scope&, scope&, const location&);
+ }
+}
+
+#endif // BUILD_CONFIG_MODULE
diff --git a/build/config/module.cxx b/build/config/module.cxx
new file mode 100644
index 0000000..bbaccdc
--- /dev/null
+++ b/build/config/module.cxx
@@ -0,0 +1,43 @@
+// file : build/config/module.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#include <build/config/module>
+
+#include <build/path>
+#include <build/scope>
+#include <build/diagnostics>
+
+using namespace std;
+
+namespace build
+{
+ namespace config
+ {
+ static bool
+ trigger (scope&, const path& p)
+ {
+ tracer trace ("config::trigger");
+
+ level4 ([&]{trace << "intercepted sourcing of " << p;});
+ return false;
+ }
+
+ void
+ load (scope& root, scope& base, const location& l)
+ {
+ tracer trace ("config::load");
+
+ if (&root != &base)
+ fail (l) << "config module must be loaded in project root scope";
+
+ //@@ TODO: avoid multiple loads (generally, for modules).
+ //
+ level4 ([&]{trace << "for " << root.path () << '/';});
+
+ // Register the build/config.build loading trigger.
+ //
+ root.triggers[path ("build/config.build")] = &trigger;
+ }
+ }
+}
diff --git a/build/config/operation b/build/config/operation
new file mode 100644
index 0000000..a233e63
--- /dev/null
+++ b/build/config/operation
@@ -0,0 +1,17 @@
+// file : build/config/operation -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BUILD_CONFIG_OPERATION
+#define BUILD_CONFIG_OPERATION
+
+#include <build/operation>
+
+namespace build
+{
+ namespace config
+ {
+ }
+}
+
+#endif // BUILD_CONFIG_OPERATION
diff --git a/build/config/operation.cxx b/build/config/operation.cxx
new file mode 100644
index 0000000..cc04929
--- /dev/null
+++ b/build/config/operation.cxx
@@ -0,0 +1,14 @@
+// file : build/config/operation.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#include <build/config/operation>
+
+using namespace std;
+
+namespace build
+{
+ namespace config
+ {
+ }
+}