aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/dist/rule.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-12-01 10:00:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-12-01 10:00:37 +0200
commitf8de93520fd604a3771a2af3ca9564f6085d8baa (patch)
treeed55bf099269efa3453943336c77ce236c2577a6 /libbuild2/dist/rule.hxx
parenta6f5ad72f4c751cd62566de227a7cbe89ff3af26 (diff)
Make dist::rule reusable as base
Diffstat (limited to 'libbuild2/dist/rule.hxx')
-rw-r--r--libbuild2/dist/rule.hxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/libbuild2/dist/rule.hxx b/libbuild2/dist/rule.hxx
index ec6c41a..69ab3d9 100644
--- a/libbuild2/dist/rule.hxx
+++ b/libbuild2/dist/rule.hxx
@@ -13,6 +13,8 @@
#include <libbuild2/dist/types.hxx>
+#include <libbuild2/export.hxx>
+
namespace build2
{
namespace dist
@@ -21,27 +23,28 @@ namespace build2
//
// A custom rule (usually the same as perform_update) may be necessary to
// establish group links (so that we see the dist variable set on a group)
- // or to see through non-see-through groups (like lib{}; see the
- // bin::lib_rule for an example). Note that in the latter case the rule
- // should "see" all its members for the dist case.
+ // or to see through non-see-through groups (like lib{}, obj{}; see rule
+ // in the bin module for an example). Note that in the latter case the
+ // rule should "see" all its members for the dist case.
//
- class rule: public simple_rule
+ class LIBBUILD2_SYMEXPORT rule: public simple_rule
{
public:
- explicit
- rule (postponed_prerequisites& p): postponed_ (p) {}
+ rule () {}
+ // Always matches (returns true).
+ //
virtual bool
match (action, target&) const override;
+ // Matches all the prerequisites (including from group) and returns
+ // noop_recipe (which will never be executed).
+ //
virtual recipe
apply (action, target&) const override;
static void
- match_postponed (action, const target&, const prerequisite&);
-
- private:
- postponed_prerequisites& postponed_;
+ match_postponed (const postponed_prerequisite&);
};
}
}