aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-12-03 14:52:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-12-03 16:48:07 +0200
commit35b736a6067ee76d86b9c2421305319a85ae19b1 (patch)
treedbd8f8ad817a98f2a439c0196da9bd3b7f46a92e
parentb259a318223370881d5244cc38ff8a7be58e2a3e (diff)
Support dir{}/fsdir{} idiosyncrasies in $name.*() function family
-rw-r--r--libbuild2/functions-name.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbuild2/functions-name.cxx b/libbuild2/functions-name.cxx
index c11b4b5..17a8adb 100644
--- a/libbuild2/functions-name.cxx
+++ b/libbuild2/functions-name.cxx
@@ -39,6 +39,12 @@ namespace build2
if (rp.first != nullptr)
n.type = rp.first->name;
+ if (n.value.empty () && (n.type == "dir" || n.type == "fsdir"))
+ {
+ n.value = n.dir.leaf ().string ();
+ n.dir.make_directory ();
+ }
+
return make_pair (move (n), move (rp.second));
}