aboutsummaryrefslogtreecommitdiff
path: root/build/cxx/install.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-31 12:52:20 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-31 12:52:20 +0200
commitbbd0f3bb21442a2833916110cbe8e9a07e9f4c1f (patch)
treed25de6f2bcfa4b6cabe1fd55a1b8f508005de4c1 /build/cxx/install.cxx
parent729b56300c441a0d63c7d2013eb5a881211d352b (diff)
Essential install module functionality
Diffstat (limited to 'build/cxx/install.cxx')
-rw-r--r--build/cxx/install.cxx48
1 files changed, 48 insertions, 0 deletions
diff --git a/build/cxx/install.cxx b/build/cxx/install.cxx
new file mode 100644
index 0000000..b623349
--- /dev/null
+++ b/build/cxx/install.cxx
@@ -0,0 +1,48 @@
+// file : build/cxx/install.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#include <build/cxx/install>
+
+#include <build/bin/target>
+
+#include <build/cxx/target>
+#include <build/cxx/link>
+
+using namespace std;
+
+namespace build
+{
+ namespace cxx
+ {
+ using namespace bin;
+
+ bool install::
+ filter (action, target& t, prerequisite_member p) const
+ {
+ // Don't install executable's prerequisite headers.
+ //
+ if (t.is_a<exe> () &&
+ (p.is_a<hxx> () || p.is_a<ixx> () || p.is_a<txx> () || p.is_a<h> ()))
+ return false;
+
+ return true;
+ }
+
+ match_result install::
+ match (action a, target& t, const std::string& hint) const
+ {
+ // @@ How do we split the hint between the two?
+ //
+
+ // We only want to handle installation if we are also the
+ // ones building this target. So first run link's match().
+ //
+ match_result r (link::instance.match (a, t, hint));
+
+ return r ? install::rule::match (a, t, "") : r;
+ }
+
+ install install::instance;
+ }
+}