aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbuild2/context.hxx2
-rw-r--r--libbuild2/install/rule.cxx9
-rw-r--r--libbuild2/install/rule.hxx5
3 files changed, 13 insertions, 3 deletions
diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx
index 7ac4af4..c4d85c9 100644
--- a/libbuild2/context.hxx
+++ b/libbuild2/context.hxx
@@ -460,7 +460,7 @@ namespace build2
// test) with a more natural-looking result. Note that currently we only
// recognize the built-in clean variable (for other variables we will need
// some kind of registration in an operation-to-variable map, probably in
- // root scope).
+ // root scope). See also install::file_rule::filter().
//
// To query this value in rule implementations use the include() helpers
// from <libbuild2/prerequisites.hxx>.
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<exe> ())
- return nullptr;
+ {
+ // Feels like one day this should be unified with include (see
+ // context::var_include).
+ //
+ if (p.vars.empty () ||
+ cast_empty<path> (p.vars["install"]).string () != "true")
+ return nullptr;
+ }
const target& pt (search (t, p));
return is == nullptr || pt.in (*is) ? &pt : nullptr;
diff --git a/libbuild2/install/rule.hxx b/libbuild2/install/rule.hxx
index 61c0ae9..53d97d2 100644
--- a/libbuild2/install/rule.hxx
+++ b/libbuild2/install/rule.hxx
@@ -115,7 +115,10 @@ namespace build2
// ignores exe{} prerequisites assuming an exe{} listed for a file
// target is there to execute (e.g., to generate that target) and
// normally should not be installed (an exe{} would typically be
- // installed via the dir{./} alias).
+ // installed via the dir{./} alias). But this can be overridden with a
+ // prerequisite-specific install=true, for example:
+ //
+ // exe{foo}: exe{bar}: install = true # foo runs bar
//
// The prerequisite is passed as an iterator allowing the filter to
// "see" inside groups.