diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-23 09:23:16 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-29 10:21:12 +0200 |
commit | e05f7c7383cc48823bd408c0bc5187191a9a1c48 (patch) | |
tree | 024bb9c3be9c876b8822388baf1622cad03d7563 /libbuild2/adhoc-rule-cxx.cxx | |
parent | 349b34108752e2fcf1ead648ffec8e5acfe4a91c (diff) |
Explicit group: static members
Diffstat (limited to 'libbuild2/adhoc-rule-cxx.cxx')
-rw-r--r-- | libbuild2/adhoc-rule-cxx.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libbuild2/adhoc-rule-cxx.cxx b/libbuild2/adhoc-rule-cxx.cxx index db5c5ab..ad19481 100644 --- a/libbuild2/adhoc-rule-cxx.cxx +++ b/libbuild2/adhoc-rule-cxx.cxx @@ -95,8 +95,10 @@ namespace build2 load_module_library (const path& lib, const string& sym, string& err); bool adhoc_cxx_rule:: - match (action a, target& t, const string& hint, match_extra& me) const + match (action a, target& xt, const string& hint, match_extra& me) const { + const target& t (xt); // See adhoc_rule::match() for background. + if (pattern != nullptr && !pattern->match (a, t, hint, me)) return false; @@ -674,13 +676,24 @@ namespace build2 } } - return impl->match (a, t, hint, me); + return impl->match (a, xt, hint, me); } #endif // BUILD2_BOOTSTRAP || LIBBUILD2_STATIC_BUILD recipe adhoc_cxx_rule:: apply (action a, target& t, match_extra& me) const { + // Handle matching explicit group member (see adhoc_rule::match() for + // background). + // + if (const group* g = (t.group != nullptr + ? t.group->is_a<group> () + : nullptr)) + { + match_sync (a, *g); + return group_recipe; // Execute the group's recipe. + } + return impl.load (memory_order_relaxed)->apply (a, t, me); } } |