aboutsummaryrefslogtreecommitdiff
path: root/build/dump.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-13 15:50:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-13 15:50:17 +0200
commitace1743f7f78bb13f99553d6e97ad1beecf1ba99 (patch)
tree595bc9dad989e44f4be9a67e351219f3248dc5f0 /build/dump.cxx
parent534f9d8db025d58c9ce23f3b81a37e8c34386a27 (diff)
Add separate type to represent directory paths
Diffstat (limited to 'build/dump.cxx')
-rw-r--r--build/dump.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/build/dump.cxx b/build/dump.cxx
index 05ec679..b41e489 100644
--- a/build/dump.cxx
+++ b/build/dump.cxx
@@ -25,7 +25,12 @@ namespace build
for (const prerequisite& p: t.prerequisites)
{
- os << ' ' << p;
+ os << ' ';
+
+ if (p.target != nullptr)
+ os << *p.target;
+ else
+ os << p;
}
}
@@ -36,15 +41,14 @@ namespace build
string& ind,
set<const target*>& rts)
{
- string d (relative (p.path ()).string ());
-
- if (d.back () != path::traits::directory_separator)
- d += '/';
-
- os << ind << d << ":" << endl
+ // We don't want the extra notations (e.g., ~/) provided by
+ // diag_relative() since we want the path to be relative to
+ // the outer scope.
+ //
+ os << ind << relative (p.path ()) << ":" << endl
<< ind << '{';
- const path* orb (relative_base);
+ const dir_path* orb (relative_base);
relative_base = &p.path ();
ind += " ";