aboutsummaryrefslogtreecommitdiff
path: root/build/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-02-19 16:10:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-02-19 16:10:03 +0200
commit8bd89cfca333e58f6990d7d168649dfc79878f31 (patch)
tree730bb9eec4fc5ddd086ed8465c4d7c0030db0d6b /build/context.cxx
parentb0524a0b18eec9d5e5c3f6ce30b6cecdd02a6306 (diff)
Add support for sourcing/including buildfiles, print, dir{} alias
Diffstat (limited to 'build/context.cxx')
-rw-r--r--build/context.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/build/context.cxx b/build/context.cxx
index 2eb76c0..4d1d1e4 100644
--- a/build/context.cxx
+++ b/build/context.cxx
@@ -5,6 +5,7 @@
#include <build/context>
#include <ostream>
+#include <cassert>
using namespace std;
@@ -20,6 +21,20 @@ namespace build
path out_base;
path
+ src_out (const path& o)
+ {
+ assert (o.sub (out_root));
+ return src_root / o.leaf (out_root);
+ }
+
+ path
+ out_src (const path& s)
+ {
+ assert (s.sub (src_root));
+ return out_root / s.leaf (src_root);
+ }
+
+ path
translate (const path& p)
{
if (p.sub (work))