From 02f717d4b7883451f37bb690c7708dda21cc4419 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 4 Mar 2017 19:13:46 +0200 Subject: Call import_existing() from search_existing() now that we have it --- build2/algorithm | 6 ++---- build2/algorithm.cxx | 13 ++++++------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'build2') 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 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. -- cgit v1.1