aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/rule.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-10-20 15:16:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-10-20 15:16:28 +0200
commit51666badaa58d1cc70a05b362dbf9fbef64a7296 (patch)
tree2919f013c9c1c12c7d31ee0b60eb0fbcb4130558 /libbuild2/rule.hxx
parentecc0f934eff0443490202b614a73097e75b1e3db (diff)
Add operation callback for adhoc rule match and apply
Diffstat (limited to 'libbuild2/rule.hxx')
-rw-r--r--libbuild2/rule.hxx25
1 files changed, 12 insertions, 13 deletions
diff --git a/libbuild2/rule.hxx b/libbuild2/rule.hxx
index ae9c865..fa61bc5 100644
--- a/libbuild2/rule.hxx
+++ b/libbuild2/rule.hxx
@@ -24,17 +24,17 @@ namespace build2
//
// Note: match() is only called once but may not be followed by apply().
//
+ // The match_extra argument is used to pass additional information that is
+ // only needed by some rule implementations. It is also a way for us to
+ // later pass more information without breaking source compatibility.
+ //
+ struct match_extra
+ {
+ };
+
class LIBBUILD2_SYMEXPORT rule
{
public:
- // The match_extra argument is used to pass additional information that is
- // only needed by some rule implementations. It is also a way for us to
- // later pass more information without breaking source compatibility.
- //
- struct match_extra
- {
- };
-
virtual bool
match (action, target&, const string& hint, match_extra&) const = 0;
@@ -144,7 +144,7 @@ namespace build2
//
// Note: not exported.
//
- class adhoc_rule: public simple_rule
+ class adhoc_rule: public rule
{
public:
location_value loc; // Buildfile location of the recipe.
@@ -174,12 +174,11 @@ namespace build2
// interface.
//
virtual bool
- match (action, target&, const string&, optional<action> fallback) const;
+ match (action, target&, const string&, match_extra&,
+ optional<action> fallback) const;
virtual bool
- match (action, target&, const string&) const override;
-
- using simple_rule::match; // To make Clang happy.
+ match (action, target&, const string&, match_extra&) const override;
// Dump support.
//