From fefe0657f29b8db782f7a722dd46b074b991cf08 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 23 Feb 2015 15:56:03 +0200 Subject: Redo rule match/build logic Now the rule is fully responsible for searching, matching, and building of prerequisites. --- build/diagnostics.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'build/diagnostics.cxx') 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 +#include #include 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) { -- cgit v1.1