aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-10-19 17:21:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-10-19 17:21:36 +0200
commit506ed2155bdf678eee6ff21272ef603280eb7a91 (patch)
tree374c1e97b3f36ad4d877256d1be0b6e316c7841e
parent2cab7b3c2618be9328545e66fc340faea6b15f45 (diff)
Handle operation-specific variable values in post hoc logic
-rw-r--r--libbuild2/algorithm.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx
index e11275d..cb63e87 100644
--- a/libbuild2/algorithm.cxx
+++ b/libbuild2/algorithm.cxx
@@ -851,8 +851,26 @@ namespace build2
{
for (const prerequisite& p: group_prerequisites (t))
{
- if (include (a, t, p) == include_type::posthoc)
+ // Note that we have to ignore any operation-specific values for
+ // non-posthoc prerequisites. See include_impl() for details.
+ //
+ lookup l;
+ if (include (a, t, p, &l) == include_type::posthoc)
{
+ if (l)
+ {
+ const string& v (cast<string> (l));
+
+ // The only valid values are true and false and the latter would
+ // have been translated to include_type::exclude.
+ //
+ if (v != "true")
+ {
+ fail << "unrecognized " << *l.var << " variable value "
+ << "'" << v << "' specified for prerequisite " << p;
+ }
+ }
+
pts.push_back (&search (t, p)); // May fail.
}
}