From 70f7fd69b448263fc27b9dceba1663810f4885ab Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Apr 2022 12:24:23 +0200 Subject: Register ad hoc rules for configure in addition to dist --- libbuild2/parser.cxx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'libbuild2/parser.cxx') diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx index c97e19e..99e67a7 100644 --- a/libbuild2/parser.cxx +++ b/libbuild2/parser.cxx @@ -1249,19 +1249,23 @@ namespace build2 // sources into the distribution. Unless there is an explicit // recipe for dist. // + // And the same for the configure meta-operation to, for + // example, make sure a hinted ad hoc rule matches. + // if (a.meta_operation () == perform_id) { - action da (dist_id, a.operation ()); - - for (shared_ptr& pr: rp.rules) + auto reg = [this, ttype, &rp, &r] (action ea) + { + for (shared_ptr& pr: rp.rules) for (action a: pr->actions) - if (da == a) - goto skip; + if (ea == a) + return; - scope_->rules.insert (da, *ttype, rp.rule_name, r); + scope_->rules.insert (ea, *ttype, rp.rule_name, r); + }; - skip: - ; + reg (action (dist_id, a.operation ())); + reg (action (configure_id, a.operation ())); } // @@ TODO: if this rule does dynamic member discovery of a -- cgit v1.1