aboutsummaryrefslogtreecommitdiff
path: root/build/diagnostics.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-03-27 16:14:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-03-27 16:14:10 +0200
commitc699c956d75dfaaded5bb24c5ea16edc73588649 (patch)
tree168245560a535714c841ded6640b69b22bf7b08d /build/diagnostics.cxx
parent9c02d307d69faa6e3c7056d8e07f16c75c189f92 (diff)
Rework dependency state dump support
We now have a combined (scopes, variables, and targets) dump.
Diffstat (limited to 'build/diagnostics.cxx')
-rw-r--r--build/diagnostics.cxx20
1 files changed, 11 insertions, 9 deletions
diff --git a/build/diagnostics.cxx b/build/diagnostics.cxx
index f5802de..53d1a09 100644
--- a/build/diagnostics.cxx
+++ b/build/diagnostics.cxx
@@ -14,11 +14,13 @@ using namespace std;
namespace build
{
string
- diag_relative_work (const path& p)
+ diag_relative (const path& p)
{
+ const path& b (*relative_base);
+
if (p.absolute ())
{
- if (p == work)
+ if (p == b)
return ".";
#ifndef _WIN32
@@ -26,26 +28,26 @@ namespace build
return "~";
#endif
- path rw (relative_work (p));
+ path rb (relative (p));
#ifndef _WIN32
- if (rw.relative ())
+ if (rb.relative ())
{
// See if the original path with the ~/ shortcut is better
- // that the relative to work.
+ // that the relative to base.
//
if (p.sub (home))
{
path rh (p.leaf (home));
- if (rw.string ().size () > rh.string ().size () + 2) // 2 for '~/'
+ if (rb.string ().size () > rh.string ().size () + 2) // 2 for '~/'
return "~/" + rh.string ();
}
}
- else if (rw.sub (home))
- return "~/" + rw.leaf (home).string ();
+ else if (rb.sub (home))
+ return "~/" + rb.leaf (home).string ();
#endif
- return rw.string ();
+ return rb.string ();
}
return p.string ();