aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-09 14:08:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-09 14:08:11 +0200
commit7ff233863b9226a59acf49092076fbec541bb11d (patch)
treee81ece63bb7959281dfe2f3b2d2279c74f33b624 /libbuild2/target.cxx
parentee02acafdcd9bd21d4daf41cee5ca15e94561630 (diff)
Handle empty target_key value (directory) in as_name()
Diffstat (limited to 'libbuild2/target.cxx')
-rw-r--r--libbuild2/target.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/libbuild2/target.cxx b/libbuild2/target.cxx
index b65a4fa..e3ad367 100644
--- a/libbuild2/target.cxx
+++ b/libbuild2/target.cxx
@@ -47,15 +47,21 @@ namespace build2
void target_key::
as_name (names& r) const
{
- string v (*name);
- target::combine_name (v, ext, false /* @@ TODO: what to do? */);
+ string v;
+ if (!name->empty ())
+ {
+ v = *name;
+ target::combine_name (v, ext, false /* @@ TODO: what to do? */);
+ }
+ else
+ assert (!ext);
- r.push_back (build2::name (*dir, type->name, move (v)));
+ r.emplace_back (*dir, type->name, move (v));
if (!out->empty ())
{
r.back ().pair = '@';
- r.push_back (build2::name (*out));
+ r.emplace_back (*out);
}
}