aboutsummaryrefslogtreecommitdiff
path: root/build/diagnostics.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-02-23 15:56:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-02-23 15:56:03 +0200
commitfefe0657f29b8db782f7a722dd46b074b991cf08 (patch)
tree62008e350c4f6048a68444fe50c47281643d276a /build/diagnostics.cxx
parent962cb1040670977085f0a187ecc6730608578151 (diff)
Redo rule match/build logic
Now the rule is fully responsible for searching, matching, and building of prerequisites.
Diffstat (limited to 'build/diagnostics.cxx')
-rw-r--r--build/diagnostics.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/build/diagnostics.cxx b/build/diagnostics.cxx
index 6b524a5..e2e8b95 100644
--- a/build/diagnostics.cxx
+++ b/build/diagnostics.cxx
@@ -6,12 +6,31 @@
#include <iostream>
+#include <build/context>
#include <build/utility>
using namespace std;
namespace build
{
+ string
+ diag_relative_work (const path& p)
+ {
+ if (p.absolute ())
+ {
+ path rp (relative_work (p));
+
+#ifndef _WIN32
+ if (rp.absolute () && rp.sub (home))
+ return "~/" + rp.leaf (home).string ();
+#endif
+
+ return rp.string ();
+ }
+
+ return p.string ();
+ }
+
void
print_process (const char* const* args)
{