diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-25 09:45:01 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-29 10:21:12 +0200 |
commit | 9650726961a281ea982660c2cc82d4da046b5622 (patch) | |
tree | 9cbcb422381695756a352b0df14c9a8852a16d9d /libbuild2/dyndep.hxx | |
parent | e05f7c7383cc48823bd408c0bc5187191a9a1c48 (diff) |
Explicit group: dynamic members
Diffstat (limited to 'libbuild2/dyndep.hxx')
-rw-r--r-- | libbuild2/dyndep.hxx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/libbuild2/dyndep.hxx b/libbuild2/dyndep.hxx index 6ae585e..0463215 100644 --- a/libbuild2/dyndep.hxx +++ b/libbuild2/dyndep.hxx @@ -243,12 +243,31 @@ namespace build2 template <typename T> static const T& - inject_group_member (action a, const scope& bs, mtime_target& g, path p) + inject_group_member (action a, const scope& bs, mtime_target& g, path f) { return inject_group_member ( - a, bs, g, move (p), T::static_type).template as<T> (); + a, bs, g, move (f), T::static_type).template as<T> (); } + // As above but the target type is determined using the map_extension + // function if specified, falling back to the fallback type if unable to + // (the what argument is used for diagnostics during this process). Return + // the target and an indication of whether it was made a member. + // + // If specified, the group_filter function is called on the target before + // making it a group member, skipping it if this function returns false. + // + using group_filter_func = bool (mtime_target& g, const file&); + + static pair<const file&, bool> + inject_group_member (const char* what, + action, const scope& base, mtime_target& g, + path, + const function<map_extension_func>&, + const target_type& fallback, + const function<group_filter_func>& = nullptr); + + // Find or insert a target file path as a target, make it a member of the // specified ad hoc group unless it already is, and set its path. Return // the target and an indication of whether it was added as a member. |