From 33256470a38504a5fcfdf050784efbf0dc93144c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 2 Aug 2022 13:29:39 +0200 Subject: Make bash.in rule match exe{} without bash{} modules with hint --- libbuild2/bash/rule.cxx | 15 ++++++++------- libbuild2/bash/rule.hxx | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libbuild2/bash/rule.cxx b/libbuild2/bash/rule.cxx index 55f3cf0..2abddc3 100644 --- a/libbuild2/bash/rule.cxx +++ b/libbuild2/bash/rule.cxx @@ -63,16 +63,16 @@ namespace build2 // in_rule // bool in_rule:: - match (action a, target& t) const + match (action a, target& t, const string& hint, match_extra&) const { tracer trace ("bash::in_rule::match"); - // Note that for bash{} we match even if the target does not depend on - // any modules (while it could have been handled by the in module, that - // would require loading it). + // Note that for bash{} and for exe{} with hint we match even if the + // target does not depend on any modules (while it could have been + // handled by the in module, that would require loading it). // - bool fi (false); // Found in. - bool fm (t.is_a ()); // Found module. + bool fi (false); // Found in. + bool fm (!hint.empty () || t.is_a ()); // Found module. for (prerequisite_member p: group_prerequisite_members (a, t)) { if (include (a, t, p) != include_type::normal) // Excluded/ad hoc. @@ -86,7 +86,8 @@ namespace build2 l4 ([&]{trace << "no in file prerequisite for target " << t;}); if (!fm) - l4 ([&]{trace << "no bash module prerequisite for target " << t;}); + l4 ([&]{trace << "no bash module prerequisite or hint for target " + << t;}); return fi && fm; } diff --git a/libbuild2/bash/rule.hxx b/libbuild2/bash/rule.hxx index 3da0c73..246ec4a 100644 --- a/libbuild2/bash/rule.hxx +++ b/libbuild2/bash/rule.hxx @@ -32,7 +32,7 @@ namespace build2 in_rule (): rule ("bash.in 1", "bash.in", '@', false /* strict */) {} virtual bool - match (action, target&) const override; + match (action, target&, const string&, match_extra&) const override; virtual recipe apply (action, target&) const override; -- cgit v1.1