summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-02 11:53:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-02 11:53:40 (GMT)
commit855a7158ed5455f91892d408c4cdbf49e1b232cc (patch)
tree9a1cf511fd9b619e43b3d31599aa87445982d1ca /Source/cmGeneratorTarget.cxx
parent1b0b0c6427f5defe6dc8ede404f36d190276652a (diff)
parent9436ad35df17df89e1a74f91103b04baad085127 (diff)
downloadCMake-855a7158ed5455f91892d408c4cdbf49e1b232cc.zip
CMake-855a7158ed5455f91892d408c4cdbf49e1b232cc.tar.gz
CMake-855a7158ed5455f91892d408c4cdbf49e1b232cc.tar.bz2
Merge topic 'target_link_libraries-self-link-is-an-error'
9436ad35df target_link_libraries: self-link through ALIAS is an error Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4826
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 39224d1..dcdaaea 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -7030,6 +7030,13 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
// Skip entries that resolve to the target itself or are empty.
std::string name = this->CheckCMP0004(lib);
+ if (this->GetPolicyStatusCMP0108() == cmPolicies::NEW) {
+ // resolve alias name
+ auto target = this->Makefile->FindTargetToUse(name);
+ if (target) {
+ name = target->GetName();
+ }
+ }
if (name == this->GetName() || name.empty()) {
if (name == this->GetName()) {
bool noMessage = false;