summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetLinkLibrariesCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-07-03 13:37:29 (GMT)
committerBrad King <brad.king@kitware.com>2018-07-03 13:39:28 (GMT)
commit0d7114987c78085df6449e93bdda8a1749862025 (patch)
tree75c224b433f683fa81b9ec0afc3d0fed7170d296 /Source/cmTargetLinkLibrariesCommand.cxx
parent51e7d4150756a01d51da38acfd0a469b138e1fde (diff)
downloadCMake-0d7114987c78085df6449e93bdda8a1749862025.zip
CMake-0d7114987c78085df6449e93bdda8a1749862025.tar.gz
CMake-0d7114987c78085df6449e93bdda8a1749862025.tar.bz2
Revert "target_link_libraries: Allow use with targets in other directories"
Revert commit v3.12.0-rc1~82^2 (target_link_libraries: Allow use with targets in other directories, 2018-05-11). The RHS target scoping and visibility rules are not clear and will need further investigation before the feature can be added. Issue: #17943
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx11
1 files changed, 2 insertions, 9 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 73f9a2e..1bbcf46 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -365,7 +365,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
if (this->CurrentProcessingState != ProcessingKeywordLinkInterface &&
this->CurrentProcessingState != ProcessingPlainLinkInterface) {
- // Find target on the LHS locally
+ // Assure that the target on the LHS was created in the current directory.
cmTarget* t =
this->Makefile->FindLocalNonAliasTarget(this->Target->GetName());
if (!t) {
@@ -378,18 +378,11 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
}
}
}
-
- // If no local target has been found, find it in the global scope
- if (!t) {
- t = this->Makefile->GetGlobalGenerator()->FindTarget(
- this->Target->GetName(), true);
- }
-
if (!t) {
std::ostringstream e;
e << "Attempt to add link library \"" << lib << "\" to target \""
<< this->Target->GetName()
- << "\" which does not exist or is an alias target.";
+ << "\" which is not built in this directory.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return false;
}