summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-04-30 13:18:47 -0400
committerBrad King <brad.king@kitware.com>2019-04-30 13:53:10 -0400
commit3d3713121b55320ce8031b838ba5ca5b844f2975 (patch)
treeba0bf61f296b2eacff202876ce9937ce241b8762 /Source
parent30c3effa89ceda247cd2ff29b5d3f4da8c7a8ff6 (diff)
downloadcmake-3d3713121b55320ce8031b838ba5ca5b844f2975.tar.gz
target_link_libraries: Fix static library private deps in other dirs
In commit a1ad0a699b (target_link_libraries: Allow use with targets in other directories, 2018-09-07, v3.13.0-rc1~94^2) we accidentally broke the logic that adds `$<LINK_ONLY:...>` to private dependencies of static libraries in their `INTERFACE_LINK_LIBRARIES` in the case that the dependency is added from outside the directory creating the library. The check for a valid target name should apply to the original name specified by the caller and not the encoded cross-directory reference. Fixes: #19197
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index ad33f98502..ded6831479 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -452,8 +452,8 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY) {
std::string configLib =
this->Target->GetDebugGeneratorExpressions(libRef, llt);
- if (cmGeneratorExpression::IsValidTargetName(libRef) ||
- cmGeneratorExpression::Find(libRef) != std::string::npos) {
+ if (cmGeneratorExpression::IsValidTargetName(lib) ||
+ cmGeneratorExpression::Find(lib) != std::string::npos) {
configLib = "$<LINK_ONLY:" + configLib + ">";
}
this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",