aboutsummaryrefslogtreecommitdiff
path: root/build/dist/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-08-27 15:11:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-08-27 15:11:40 +0200
commitfd689eb883655dcb29e505b041cd02fac01f0bac (patch)
tree0d85ec32d95a1c96eaa7eff28734b900c44dd3ca /build/dist/rule.cxx
parent7f2d06258d57e39940e8fa959336da0ea66fe37f (diff)
Dist module/meta-operation initial implementation
Diffstat (limited to 'build/dist/rule.cxx')
-rw-r--r--build/dist/rule.cxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/build/dist/rule.cxx b/build/dist/rule.cxx
new file mode 100644
index 0000000..bda2ef7
--- /dev/null
+++ b/build/dist/rule.cxx
@@ -0,0 +1,49 @@
+// file : build/dist/rule.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#include <build/dist/rule>
+
+#include <build/scope>
+#include <build/target>
+#include <build/algorithm>
+#include <build/diagnostics>
+
+using namespace std;
+
+namespace build
+{
+ namespace dist
+ {
+ match_result rule::
+ match (action, target& t, const std::string&) const
+ {
+ return t; // We always match.
+ }
+
+ recipe rule::
+ apply (action a, target& t, const match_result&) const
+ {
+ const dir_path& out_root (t.root_scope ().path ());
+
+ for (prerequisite_member p: group_prerequisite_members (a, t))
+ {
+ // Skip prerequisites imported from other projects.
+ //
+ if (p.proj () != nullptr)
+ continue;
+
+ // @@ This is where we will handle dist/nodist.
+
+ target& pt (p.search ());
+
+ // Don't match targets that are outside our project.
+ //
+ if (pt.dir.sub (out_root))
+ build::match (a, pt);
+ }
+
+ return noop_recipe; // We will never be executed.
+ }
+ }
+}