From 6a8d4d6a89794a775f4fc786c0e415c504aeeac9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Nov 2024 09:42:46 +0200 Subject: Make $target.path() work for dir{} and fsdir{} targets --- libbuild2/functions-target.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libbuild2/functions-target.cxx') 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 () || t.is_a ()) + { + r.push_back (t.out_dir ()); + } else fail << "target " << t << " is not path-based"; } -- cgit v1.1