diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-02-05 12:02:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-02-05 12:02:32 +0200 |
commit | 1bb564a690e2661094e9071d4003638390a5a6fe (patch) | |
tree | 48ed8eedb1f87fd05eb66547c12349bb3db92c2b /build2/test/rule.hxx | |
parent | 7005f1f5b525705fa3fd458a840d027046a2085b (diff) |
Fix test and install rules to handle see-through groups correctly
Diffstat (limited to 'build2/test/rule.hxx')
-rw-r--r-- | build2/test/rule.hxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/build2/test/rule.hxx b/build2/test/rule.hxx index b331263..4f02390 100644 --- a/build2/test/rule.hxx +++ b/build2/test/rule.hxx @@ -20,9 +20,6 @@ namespace build2 class rule: public build2::rule, protected virtual common { public: - explicit - rule (common_data&& d): common (move (d)) {} - virtual bool match (action, target&, const string&) const override; @@ -37,26 +34,32 @@ namespace build2 target_state perform_script (action, const target&, size_t) const; + + rule (common_data&& d, bool see_through_only) + : common (move (d)), see_through (see_through_only) {} + + bool see_through; }; - class default_rule: public rule // For disambiguation in module. + class default_rule: public rule { public: explicit - default_rule (common_data&& d): common (move (d)), rule (move (d)) {} + default_rule (common_data&& d) + : common (move (d)), + rule (move (d), true /* see_through_only */) {} }; - // In addition to the above rule's semantics, this rule sees through to - // the group's members. + // To be used for non-see-through groups that should exhibit the see- + // through behavior for install (see lib{} in the bin module for an + // example). // class group_rule: public rule { public: explicit - group_rule (common_data&& d): common (move (d)), rule (move (d)) {} - - virtual recipe - apply (action, target&) const override; + group_rule (common_data&& d) + : common (move (d)), rule (move (d), false /* see_through_only */) {} }; } } |