aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-07-09 11:06:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-07-09 11:06:02 +0200
commite9f64680a152c5aafd023bb5691447012e222590 (patch)
treeb36068799bd50c74eee87f298c685d223c84f363 /libbuild2
parentd084b50790dcbf675f2d5f451c986b3128216980 (diff)
Relax prerequisite filtering semantics of aliases in test and install rules
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/install/rule.cxx3
-rw-r--r--libbuild2/install/rule.hxx3
-rw-r--r--libbuild2/test/rule.cxx10
3 files changed, 11 insertions, 5 deletions
diff --git a/libbuild2/install/rule.cxx b/libbuild2/install/rule.cxx
index 901b048..d7b0fc0 100644
--- a/libbuild2/install/rule.cxx
+++ b/libbuild2/install/rule.cxx
@@ -63,8 +63,7 @@ namespace build2
const target* alias_rule::
filter (action, const target& t, const prerequisite& p) const
{
- const target& pt (search (t, p));
- return pt.in (t.weak_scope ()) ? &pt : nullptr;
+ return &search (t, p);
}
recipe alias_rule::
diff --git a/libbuild2/install/rule.hxx b/libbuild2/install/rule.hxx
index 5896589..916fc6d 100644
--- a/libbuild2/install/rule.hxx
+++ b/libbuild2/install/rule.hxx
@@ -25,8 +25,7 @@ namespace build2
match (action, target&, const string&) const override;
// Return NULL if this prerequisite should be ignored and pointer to its
- // target otherwise. The default implementation accepts all prerequsites
- // from the target's (weak) amalgamation.
+ // target otherwise. The default implementation allows all prerequsites.
//
// The prerequisite is passed as an iterator allowing the filter to
// "see" inside groups.
diff --git a/libbuild2/test/rule.cxx b/libbuild2/test/rule.cxx
index a895e27..e1006d8 100644
--- a/libbuild2/test/rule.cxx
+++ b/libbuild2/test/rule.cxx
@@ -97,7 +97,15 @@ namespace build2
// no project at all (e.g., installed). Also, generally, not testing
// stuff that's not ours seems right.
//
- match_prerequisites (a, t, t.root_scope ());
+ // At least that was the thinking until we've added support for ad hoc
+ // importation and the ability to "pull" other project's targets in a
+ // "glue" kind of project. Also, on the other hand to the above
+ // reasoning, it is unlikely a "foreign" target is listed as a
+ // prerequisite of an alias unintentionally. For example, an alias is
+ // unlikely to depend on an installed header or library. So now we
+ // allow this.
+ //
+ match_prerequisites (a, t);
}
size_t pass_n (pts.size ()); // Number of pass-through prerequisites.