aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/parser.cxx')
-rw-r--r--libbuild2/parser.cxx25
1 files changed, 14 insertions, 11 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index 8676c9d..92e0090 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -1236,17 +1236,6 @@ namespace build2
if (!skip)
{
- if (d.first)
- {
- if (ar->recipe_text (ctx, *target_, move (t.value), d.as))
- d.clean = true;
-
- // Verify we have no unhandled attributes.
- //
- for (attribute& a: d.as)
- fail (d.as.loc) << "unknown recipe attribute " << a << endf;
- }
-
auto& ars (target_->adhoc_recipes);
ars.push_back (adhoc_recipe {{}, move (ar)});
@@ -1315,6 +1304,20 @@ namespace build2
ars.back ().actions.push_back (a);
}
}
+
+ if (d.first)
+ {
+ adhoc_recipe& ar (ars.back ());
+
+ if (ar.rule->recipe_text (
+ ctx, *target_, ar.actions, move (t.value), d.as))
+ d.clean = true;
+
+ // Verify we have no unhandled attributes.
+ //
+ for (attribute& a: d.as)
+ fail (d.as.loc) << "unknown recipe attribute " << a << endf;
+ }
}
next (t, tt);