From 0ff39fd77b3127c7a250e7f817e34dfaecbcc208 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 20 Nov 2020 22:07:37 +0300 Subject: Add support for buildscript depdb preamble --- libbuild2/parser.cxx | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'libbuild2/parser.cxx') 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); -- cgit v1.1