aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-08-02 13:29:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-08-02 13:29:39 +0200
commit33256470a38504a5fcfdf050784efbf0dc93144c (patch)
tree8e77d926de8fca7f177214c5323ff16e1aced4cc /libbuild2
parent5ae1fe4cfc96233d5acf013e0c3a6ac2c4a6b2c5 (diff)
Make bash.in rule match exe{} without bash{} modules with hint
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/bash/rule.cxx15
-rw-r--r--libbuild2/bash/rule.hxx2
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<bash> ()); // Found module.
+ bool fi (false); // Found in.
+ bool fm (!hint.empty () || t.is_a<bash> ()); // 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;