aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-08 12:24:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-04-08 12:24:23 +0200
commit70f7fd69b448263fc27b9dceba1663810f4885ab (patch)
tree9e9e3e211ec36618fc4c23dd3da17d5414cb3b6b /libbuild2
parent86a570c792e692d711dc4dc8530ff54b9980c0a4 (diff)
Register ad hoc rules for configure in addition to dist
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/parser.cxx20
1 files changed, 12 insertions, 8 deletions
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<adhoc_rule>& pr: rp.rules)
+ auto reg = [this, ttype, &rp, &r] (action ea)
+ {
+ for (shared_ptr<adhoc_rule>& 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