aboutsummaryrefslogtreecommitdiff
path: root/build/name.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-03-09 08:43:58 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-03-09 08:43:58 +0200
commit2e98d3ec3aa57c7b1776d3bf5e7e219a9a3cb3af (patch)
tree9a7fd8701853c5df17587be0ef00c61a32d6fc40 /build/name.cxx
parent7de6f6f275d840e8d9523c72d8f4309c51b4dcd3 (diff)
Build according to buildspec
At this stage operations are still ignored.
Diffstat (limited to 'build/name.cxx')
-rw-r--r--build/name.cxx19
1 files changed, 8 insertions, 11 deletions
diff --git a/build/name.cxx b/build/name.cxx
index 7f300f4..46e2440 100644
--- a/build/name.cxx
+++ b/build/name.cxx
@@ -19,8 +19,9 @@ namespace build
bool hv (!n.value.empty ());
bool hd (false);
- // Print the directory before type.
- //
+ if (ht)
+ os << n.type << '{';
+
if (!n.dir.empty ())
{
string s (diag_relative_work (n.dir));
@@ -31,24 +32,20 @@ namespace build
{
os << s;
- // Add the directory separator unless it is already there.
+ // Add the directory separator unless it is already there
+ // or we have type but no value. The idea is to print foo/
+ // or dir{foo}.
//
- if (s.back () != path::traits::directory_separator)
+ if (s.back () != path::traits::directory_separator && (hv || !ht))
os << path::traits::directory_separator;
hd = true;
}
}
- if (ht)
- os << n.type;
-
- if (ht || (hd && hv))
- os << '{';
-
os << n.value;
- if (ht || (hd && hv))
+ if (ht)
os << '}';
if (!ht && !hv && !hd)