aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/file.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-09 15:23:27 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-09 15:23:27 +0200
commitc78f03ca550bfdcec1de4e2fd96a2604476374d7 (patch)
tree156e31c8e78c4e3d8e41f0acc570537095c26f98 /libbuild2/file.cxx
parentc991cd8fa9f534817428a5523fc529518e8e1738 (diff)
Make importation of unqualified targets illegal
Diffstat (limited to 'libbuild2/file.cxx')
-rw-r--r--libbuild2/file.cxx15
1 files changed, 9 insertions, 6 deletions
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<dir_path> ());
- }
context& ctx (ibase.ctx);