From 506ed2155bdf678eee6ff21272ef603280eb7a91 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Oct 2022 17:21:36 +0200 Subject: Handle operation-specific variable values in post hoc logic --- libbuild2/algorithm.cxx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'libbuild2') 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 (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. } } -- cgit v1.1