From f745d8ba2b7d6fd6a725af5c58cd5f057fca8191 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Oct 2021 16:02:38 +0200 Subject: Allow forcing installation of exe{} prerequisites of file targets This can be achieved with prerequisite-specific install=true, for example: exe{foo}: exe{bar}: install = true # foo runs bar --- libbuild2/install/rule.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libbuild2/install/rule.cxx') diff --git a/libbuild2/install/rule.cxx b/libbuild2/install/rule.cxx index b4b4a01..2d81067 100644 --- a/libbuild2/install/rule.cxx +++ b/libbuild2/install/rule.cxx @@ -289,7 +289,14 @@ namespace build2 action, const target& t, const prerequisite& p) const { if (p.is_a ()) - return nullptr; + { + // Feels like one day this should be unified with include (see + // context::var_include). + // + if (p.vars.empty () || + cast_empty (p.vars["install"]).string () != "true") + return nullptr; + } const target& pt (search (t, p)); return is == nullptr || pt.in (*is) ? &pt : nullptr; -- cgit v1.1