From 27db5f97c0f7460c2c0d2e28660c69cbc6d1207e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 21 Mar 2022 13:39:51 +0200 Subject: Filter out exe{} prerequisites in install group rule similar to file rule --- libbuild2/install/rule.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libbuild2/install/rule.cxx') diff --git a/libbuild2/install/rule.cxx b/libbuild2/install/rule.cxx index 3ed61f3..468fcc3 100644 --- a/libbuild2/install/rule.cxx +++ b/libbuild2/install/rule.cxx @@ -215,6 +215,23 @@ namespace build2 return &m; } + const target* group_rule:: + filter (const scope* is, + action, const target& t, const prerequisite& p) const + { + // The same logic as in file_rule::filter() below. + // + if (p.is_a ()) + { + if (p.vars.empty () || + cast_empty (p.vars[var_install (t.ctx)]).string () != "true") + return nullptr; + } + + const target& pt (search (t, p)); + return is == nullptr || pt.in (*is) ? &pt : nullptr; + } + recipe group_rule:: apply (action a, target& t) const { @@ -303,6 +320,8 @@ namespace build2 filter (const scope* is, action, const target& t, const prerequisite& p) const { + // See also group_rule::filter() with identical semantics. + // if (p.is_a ()) { // Note that while include() checks for install=false, here we need to -- cgit v1.1