aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-03-04 19:13:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-04 19:13:46 +0200
commit02f717d4b7883451f37bb690c7708dda21cc4419 (patch)
tree2d0366fbd7a60da723f31dfb240eb7bb92b1835a
parent39f2b2237c559808b52341cb119c61549e46ebee (diff)
Call import_existing() from search_existing() now that we have it
-rw-r--r--build2/algorithm6
-rw-r--r--build2/algorithm.cxx13
2 files changed, 8 insertions, 11 deletions
diff --git a/build2/algorithm b/build2/algorithm
index dfe8c42..7325fac 100644
--- a/build2/algorithm
+++ b/build2/algorithm
@@ -70,10 +70,8 @@ namespace build2
const target&
search (name, const scope&);
- // As above but only search for an already existing target. Unlike the
- // above version, this one can be called during the execute phase.
- //
- // Note that currently we return NULL for project-qualified names and
+ // As above but only search for an already existing target. Unlike the above
+ // version, this one can be called during the execute phase. Return NULL for
// unknown target types.
//
const target*
diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx
index 032d657..c4342d3 100644
--- a/build2/algorithm.cxx
+++ b/build2/algorithm.cxx
@@ -67,11 +67,6 @@ namespace build2
{
assert (phase == run_phase::match || phase == run_phase::execute);
- // We don't handle this for now.
- //
- if (cn.qualified ())
- return nullptr;
-
name n (cn);
optional<string> ext;
const target_type* tt (s.find_target_type (n, ext));
@@ -85,11 +80,15 @@ namespace build2
if (!n.dir.empty ())
n.dir.normalize (false, true); // Current dir collapses to an empty one.
+ bool q (cn.qualified ());
+
// @@ OUT: for now we assume the prerequisite's out is undetermined.
// Would need to pass a pair of names.
//
- return search_existing_target (
- prerequisite_key {n.proj, {tt, &n.dir, &out, &n.value, ext}, &s});
+ prerequisite_key pk {
+ n.proj, {tt, &n.dir, q ? &empty_dir_path : &out, &n.value, ext}, &s};
+
+ return q ? import_existing (pk) : search_existing_target (pk);
}
// If the work_queue is not present, then we don't wait.