aboutsummaryrefslogtreecommitdiff
path: root/build/name.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-03-07 14:36:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-03-07 14:36:51 +0200
commit7de6f6f275d840e8d9523c72d8f4309c51b4dcd3 (patch)
tree4b0387fe8f80db3ea6214aea330c03f3d1145c08 /build/name.cxx
parent897a0e4fdf9ca90ee8d236a38e138a8ae6bc3627 (diff)
Add support for buildspec
Diffstat (limited to 'build/name.cxx')
-rw-r--r--build/name.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/build/name.cxx b/build/name.cxx
index 46e2440..7f300f4 100644
--- a/build/name.cxx
+++ b/build/name.cxx
@@ -19,9 +19,8 @@ namespace build
bool hv (!n.value.empty ());
bool hd (false);
- if (ht)
- os << n.type << '{';
-
+ // Print the directory before type.
+ //
if (!n.dir.empty ())
{
string s (diag_relative_work (n.dir));
@@ -32,20 +31,24 @@ namespace build
{
os << s;
- // 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}.
+ // Add the directory separator unless it is already there.
//
- if (s.back () != path::traits::directory_separator && (hv || !ht))
+ if (s.back () != path::traits::directory_separator)
os << path::traits::directory_separator;
hd = true;
}
}
+ if (ht)
+ os << n.type;
+
+ if (ht || (hd && hv))
+ os << '{';
+
os << n.value;
- if (ht)
+ if (ht || (hd && hv))
os << '}';
if (!ht && !hv && !hd)