From 1bb564a690e2661094e9071d4003638390a5a6fe Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Feb 2018 12:02:32 +0200 Subject: Fix test and install rules to handle see-through groups correctly --- build2/test/rule.hxx | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'build2/test/rule.hxx') diff --git a/build2/test/rule.hxx b/build2/test/rule.hxx index b3312636..4f02390e 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 */) {} }; } } -- cgit