diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-09-20 09:03:44 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-09-20 09:03:44 +0200 |
commit | 77bef9b64857b1d2ae96dafc2f531cadb374f561 (patch) | |
tree | f246f3ebc62116263521d87b7d74dba7efc2f0ae /libbuild2/rule.hxx | |
parent | b43546939b21f6c8d3e69d4ab1e44f08c0756481 (diff) |
Fix issue with fallback rule priority in dist module
While at it, also remove workarounds for the same issue in the config and
test modules.
Diffstat (limited to 'libbuild2/rule.hxx')
-rw-r--r-- | libbuild2/rule.hxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libbuild2/rule.hxx b/libbuild2/rule.hxx index 4f77432..bf6f0a5 100644 --- a/libbuild2/rule.hxx +++ b/libbuild2/rule.hxx @@ -126,10 +126,19 @@ namespace build2 virtual recipe apply (action, target&, match_extra&) const override; - file_rule () {} + // While this rule expects an mtime_target-based target, sometimes it's + // necessary to register it for something less specific (normally target) + // in order to achieve the desired rule matching priority (see the dist + // and config modules for an example). For such cases this rule can be + // instructed to check the type and only match if it's mtime_target-based. + // + file_rule (bool match_type = false): match_type_ (match_type) {} - static const file_rule instance; + static const file_rule instance; // Note: does not match the target type. static const build2::rule_match rule_match; + + private: + bool match_type_; }; class LIBBUILD2_SYMEXPORT alias_rule: public simple_rule |