aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/algorithm.cxx')
-rw-r--r--libbuild2/algorithm.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx
index 7788b90..4e47c63 100644
--- a/libbuild2/algorithm.cxx
+++ b/libbuild2/algorithm.cxx
@@ -112,6 +112,8 @@ namespace build2
assert (s.ctx.phase == run_phase::match ||
s.ctx.phase == run_phase::execute);
+ // See also scope::find_prerequisite_key().
+ //
name n (cn);
auto rp (s.find_target_type (n, location ()));
const target_type* tt (rp.first);
@@ -139,6 +141,20 @@ namespace build2
: search_existing_target (s.ctx, pk);
}
+ const target*
+ search_existing (const names& ns, const scope& s)
+ {
+ if (size_t n = ns.size ())
+ {
+ if (n == (ns[0].pair ? 2 : 1))
+ {
+ return search_existing (ns[0], s, n == 1 ? dir_path () : ns[1].dir);
+ }
+ }
+
+ fail << "invalid target name: " << ns << endf;
+ }
+
// target_lock
//
// Note that the stack may contain locks for targets from multiple nested