aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-11-06 09:42:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-11-06 09:42:46 +0200
commit6a8d4d6a89794a775f4fc786c0e415c504aeeac9 (patch)
tree5a28cc8124ca1a43b9947c4c2c16cbdc65f151cf
parent997b165904366294960659bbf28550b09cd130b9 (diff)
Make $target.path() work for dir{} and fsdir{} targets
-rw-r--r--libbuild2/functions-target.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/libbuild2/functions-target.cxx b/libbuild2/functions-target.cxx
index d564aa2..c7cb50e 100644
--- a/libbuild2/functions-target.cxx
+++ b/libbuild2/functions-target.cxx
@@ -23,10 +23,10 @@ namespace build2
//
// Return the path of a target (or a list of paths for a list of
// targets). The path must be assigned, which normally happens during
- // match. As a result, this function is normally called form a recipe.
+ // match. As a result, this function is normally called from a recipe.
//
// Note that while this function is technically not pure, we don't mark it
- // as such since it can only be called (normally form a recipe) after the
+ // as such since it can only be called (normally from a recipe) after the
// target has been matched, meaning that this target is a prerequisite and
// therefore this impurity has been accounted for.
//
@@ -53,6 +53,10 @@ namespace build2
else
fail << "target " << t << " path is not assigned";
}
+ else if (t.is_a<dir> () || t.is_a<fsdir> ())
+ {
+ r.push_back (t.out_dir ());
+ }
else
fail << "target " << t << " is not path-based";
}