From 8e42d1ec329ac16ec5ae9692f18cdb0f2444d2fb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Jun 2020 08:12:54 +0200 Subject: Fix handling of inner/outer operations in ad hoc recipes machinery --- libbuild2/rule.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'libbuild2/rule.cxx') diff --git a/libbuild2/rule.cxx b/libbuild2/rule.cxx index fb769fd..f257b62 100644 --- a/libbuild2/rule.cxx +++ b/libbuild2/rule.cxx @@ -472,12 +472,24 @@ namespace build2 recipe adhoc_script_rule:: apply (action a, target& t) const { + // If this is an outer operation (e.g., update-for-test), then delegate to + // the inner. + // + if (a.outer ()) + { + match_inner (a, t); + return execute_inner; + } + // Derive file names for the target and its ad hoc group members, if any. // - for (target* m (&t); m != nullptr; m = m->adhoc_member) + if (a == perform_update_id || a == perform_clean_id) { - if (auto* p = m->is_a ()) - p->derive_path (); + for (target* m (&t); m != nullptr; m = m->adhoc_member) + { + if (auto* p = m->is_a ()) + p->derive_path (); + } } // Inject dependency on the output directory. -- cgit v1.1