aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-12-17 11:48:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-12-17 11:48:40 +0200
commit747ff339c4be7d271a33996638b3b026a166d805 (patch)
tree3ffd726a68ca8b7125fecdf4be8f87e1afeee99d /build2/algorithm.ixx
parenta21902d3764aa64f1579f1b1bf2831789890d0da (diff)
Don't try to test out-of-project prerequisites
Diffstat (limited to 'build2/algorithm.ixx')
-rw-r--r--build2/algorithm.ixx31
1 files changed, 24 insertions, 7 deletions
diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx
index b2c4941..ac81dbe 100644
--- a/build2/algorithm.ixx
+++ b/build2/algorithm.ixx
@@ -31,10 +31,11 @@ namespace build2
const dir_path& out,
const string& name,
const string* ext,
- scope* scope)
+ scope* scope,
+ const string* proj)
{
return search (
- prerequisite_key {nullptr, {&type, &dir, &out, &name, ext}, scope});
+ prerequisite_key {proj, {&type, &dir, &out, &name, ext}, scope});
}
template <typename T>
@@ -99,28 +100,44 @@ namespace build2
return r.members != nullptr ? r : resolve_group_members_impl (a, g);
}
+ void
+ search_and_match_prerequisites (action, target&, scope*);
+
+ void
+ search_and_match_prerequisite_members (action, target&, scope*);
+
inline void
search_and_match_prerequisites (action a, target& t)
{
search_and_match_prerequisites (
a,
t,
- (a.operation () != clean_id
- ? dir_path ()
- : t.root_scope ().out_path ()));
+ (a.operation () != clean_id ? nullptr : &t.root_scope ()));
}
inline void
search_and_match_prerequisite_members (action a, target& t)
{
if (a.operation () != clean_id)
- search_and_match_prerequisite_members (a, t, dir_path ());
+ search_and_match_prerequisite_members (a, t, nullptr);
else
// Note that here we don't iterate over members even for see-
// through groups since the group target should clean eveything
// up. A bit of an optimization.
//
- search_and_match_prerequisites (a, t, t.root_scope ().out_path ());
+ search_and_match_prerequisites (a, t, &t.root_scope ());
+ }
+
+ inline void
+ search_and_match_prerequisites (action a, target& t, scope& s)
+ {
+ search_and_match_prerequisites (a, t, &s);
+ }
+
+ inline void
+ search_and_match_prerequisite_members (action a, target& t, scope& s)
+ {
+ search_and_match_prerequisite_members (a, t, &s);
}
target_state