aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/rule.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-10-17 15:01:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-11-01 10:25:35 +0200
commitc5d8a9cf5137c3272cab4981eeff97c16304de95 (patch)
treefb28084f9b022cda996c7c16d4b1370d019619a0 /libbuild2/rule.hxx
parentd3b4636ca3f4c3ad98c8096326c5b1460d05691d (diff)
Add notion of match options
Now, when matching a rule, the caller may request a subset of the full functionality of performing an operation on a target. This is achieved with match options.
Diffstat (limited to 'libbuild2/rule.hxx')
-rw-r--r--libbuild2/rule.hxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/libbuild2/rule.hxx b/libbuild2/rule.hxx
index dea9c9a..acd22fe 100644
--- a/libbuild2/rule.hxx
+++ b/libbuild2/rule.hxx
@@ -34,6 +34,10 @@ namespace build2
// implementations. It is also a way for us to later pass more information
// without breaking source compatibility.
//
+ // A rule may support match options and if such a rule is rematched with
+ // different options, then reapply() is called. See
+ // match_extra::{cur,new}_options for background and details.
+ //
struct match_extra;
class LIBBUILD2_SYMEXPORT rule
@@ -45,6 +49,9 @@ namespace build2
virtual recipe
apply (action, target&, match_extra&) const = 0;
+ virtual void
+ reapply (action, target&, match_extra&) const;
+
rule () = default;
virtual
@@ -265,8 +272,8 @@ namespace build2
// is a pattern and returns true otherwise.
//
// Note also that in case of a member of a group-based target, match() is
- // called on the group while apply() on the member (see match_rule() in
- // algorithms.cxx for details). This means that match() may be called
+ // called on the group while apply() on the member (see match_rule_impl()
+ // in algorithms.cxx for details). This means that match() may be called
// without having the target locked and as a result match() should (unless
// known to only match a non-group) treat the target as const and only
// rely on immutable information (type, name, etc) since the group could