From c78f03ca550bfdcec1de4e2fd96a2604476374d7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 9 Jun 2020 15:23:27 +0200 Subject: Make importation of unqualified targets illegal --- libbuild2/file.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'libbuild2/file.cxx') diff --git a/libbuild2/file.cxx b/libbuild2/file.cxx index f7073e6..e0467ad 100644 --- a/libbuild2/file.cxx +++ b/libbuild2/file.cxx @@ -1729,15 +1729,18 @@ namespace build2 { tracer trace ("import_search"); - // If there is no project specified for this target, then our run will be - // short and sweet: we simply return it as empty-project-qualified and - // let someone else (e.g., a rule) take a stab at it. + // Note: in the future the plan is to turn this into project-local import. // if (tgt.unqualified ()) - { - tgt.proj = project_name (); + fail (loc) << "importation of an unqualified target " << tgt << + info << "use empty project qualification to import a target " + << "without a project"; + + // If the project name is empty then we simply return it as is to let + // someone else (e.g., a rule, import phase 2) take a stab at it. + // + if (tgt.proj->empty ()) return make_pair (move (tgt), optional ()); - } context& ctx (ibase.ctx); -- cgit v1.1