aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/parser.cxx')
-rw-r--r--libbuild2/parser.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index 120d6ab..d1db568 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -1208,6 +1208,7 @@ namespace build2
default_target_ = target_;
}
+ bool multi (replay_ != replay::stop); // Multiple targets.
bool first (replay_ != replay::play); // First target.
bool clean (false); // Seen recipe that requires cleanup.
@@ -1223,13 +1224,14 @@ namespace build2
struct data
{
small_vector<shared_ptr<adhoc_rule>, 1>& recipes;
+ bool multi;
bool first;
bool& clean;
size_t i;
attributes& as;
buildspec& bs;
const location& bsloc;
- } d {recipes, first, clean, i, as, bs, bsloc};
+ } d {recipes, multi, first, clean, i, as, bs, bsloc};
// Note that this function must be called at most once per iteration.
//
@@ -1431,8 +1433,12 @@ namespace build2
{
adhoc_recipe& ar (ars.back ());
- if (ar.rule->recipe_text (
- ctx, *target_, ar.actions, move (t.value), d.as))
+ if (ar.rule->recipe_text (ctx,
+ *scope_,
+ d.multi ? nullptr : target_,
+ ar.actions,
+ move (t.value),
+ d.as))
d.clean = true;
// Verify we have no unhandled attributes.