aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/adhoc-rule-cxx.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/adhoc-rule-cxx.hxx')
-rw-r--r--libbuild2/adhoc-rule-cxx.hxx35
1 files changed, 27 insertions, 8 deletions
diff --git a/libbuild2/adhoc-rule-cxx.hxx b/libbuild2/adhoc-rule-cxx.hxx
index 0ca6038..2ac2281 100644
--- a/libbuild2/adhoc-rule-cxx.hxx
+++ b/libbuild2/adhoc-rule-cxx.hxx
@@ -26,7 +26,7 @@ namespace build2
};
// Note that when used as part of a pattern, the implementation cannot use
- // the match_extra::buffer nor the target auxilary data storage.
+ // the match_extra::data() facility nor the target auxiliary data storage.
//
class LIBBUILD2_SYMEXPORT cxx_rule_v1: public cxx_rule
{
@@ -36,11 +36,6 @@ namespace build2
// cannot be injected as a real prerequisite since it's from a different
// build context).
//
- // If pattern is not NULL then this recipe belongs to an ad hoc pattern
- // rule and apply() may need to call the pattern's apply_*() functions if
- // the pattern has any ad hoc group member substitutions or prerequisite
- // substitutions/non-patterns, respectively.
- //
const location recipe_loc; // Buildfile location of the recipe.
const target_state recipe_state; // State of recipe library target.
const adhoc_rule_pattern* pattern; // Ad hoc pattern rule of recipe.
@@ -52,8 +47,26 @@ namespace build2
// Return true by default.
//
+ // Note: must treat target as const (unless known to match a non-group).
+ // See adhoc_rule::match() for background.
+ //
virtual bool
- match (action, target&, const string&) const override;
+ match (action, target&) const override;
+
+ using simple_rule::match; // Unhide the match_extra version.
+
+ // Either this version or the one with match_extra must be overridden.
+ //
+ // If the pattern member above is not NULL then this recipe belongs to an
+ // ad hoc pattern rule and the implementation may need to call the
+ // pattern's apply_*() functions if the pattern has any ad hoc group
+ // member substitutions or prerequisite substitutions/non-patterns,
+ // respectively.
+ //
+ virtual recipe
+ apply (action, target&) const override;
+
+ using simple_rule::apply; // Unhide the match_extra version.
};
// Note: not exported.
@@ -67,12 +80,18 @@ namespace build2
virtual recipe
apply (action, target&, match_extra&) const override;
+ virtual void
+ reapply (action, target&, match_extra&) const override;
+
adhoc_cxx_rule (string, const location&, size_t,
uint64_t ver,
optional<string> sep);
virtual bool
- recipe_text (const scope&, string&&, attributes&) override;
+ recipe_text (const scope&,
+ const target_type&,
+ string&&,
+ attributes&) override;
virtual
~adhoc_cxx_rule () override;