aboutsummaryrefslogtreecommitdiff
path: root/build/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-01-08 13:27:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-01-08 13:27:15 +0200
commitab4421747146aa7995f0cfb1a639c9121c82c915 (patch)
treedeb08893c02ed0238f73becbbe80ede5568b946e /build/target.cxx
parentd3e624ef7c0fb274e62b81c4c7bd59640770520a (diff)
Implement tracing support
Also use to-relative path translation in diagnostics.
Diffstat (limited to 'build/target.cxx')
-rw-r--r--build/target.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/build/target.cxx b/build/target.cxx
index 8314ba4..4dffe7f 100644
--- a/build/target.cxx
+++ b/build/target.cxx
@@ -6,6 +6,8 @@
#include <ostream>
+#include <build/context>
+
using namespace std;
namespace build
@@ -15,9 +17,19 @@ namespace build
ostream&
operator<< (ostream& os, const target& t)
{
- // @@ TODO: need to come up with a relative (to current) path.
+ os << t.type ().name << '{';
+
+ if (!t.directory.empty ())
+ {
+ string s (diagnostic_string (t.directory));
+
+ if (!s.empty ())
+ os << s << path::traits::directory_separator;
+ }
+
+ os << t.name << '}';
- return os << t.type ().name << '{' << t.name << '}';
+ return os;
}
target_set targets;