diff options
-rw-r--r-- | build2/algorithm | 6 | ||||
-rw-r--r-- | build2/algorithm.cxx | 13 |
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. |