From f0cfe78cb306532518d42e3d2b8e59405d006717 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 12 Feb 2024 05:59:39 +0200 Subject: Allow overriding apply(match_extra) version in cxx_rule_v1 --- libbuild2/adhoc-rule-cxx.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libbuild2/adhoc-rule-cxx.cxx') diff --git a/libbuild2/adhoc-rule-cxx.cxx b/libbuild2/adhoc-rule-cxx.cxx index 637f9af..2ac97eb 100644 --- a/libbuild2/adhoc-rule-cxx.cxx +++ b/libbuild2/adhoc-rule-cxx.cxx @@ -25,6 +25,13 @@ namespace build2 return true; } + recipe cxx_rule_v1:: + apply (action, target&) const + { + assert (false); // This (or the match_extra version) must be overriden. + return empty_recipe; + } + // adhoc_cxx_rule // adhoc_cxx_rule:: @@ -699,6 +706,13 @@ namespace build2 return group_recipe; // Execute the group's recipe. } + // Note that while we probably could call pattern's apply_group_members() + // here, apply_group_prerequisites() is normally called after adding + // prerequisites but before matching, which can only be done from the + // rule's implementation. Also, for apply_group_members(), there is the + // explicit group special case which may also require custom logic. + // So it feels best to leave both to the implementation. + return impl.load (memory_order_relaxed)->apply (a, t, me); } -- cgit v1.1