diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2023-03-05 13:36:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-06 14:15:48 (GMT) |
commit | ce1bdec3a4f5fb10a1bd6df3ab0ca469c2f8a22d (patch) | |
tree | 01eded251c32a1bf2b6cf07eb92a767207046a5a /Source | |
parent | 20e3884e9e71d7a9ffcd827d5ae813ed3437f024 (diff) | |
download | CMake-ce1bdec3a4f5fb10a1bd6df3ab0ca469c2f8a22d.zip CMake-ce1bdec3a4f5fb10a1bd6df3ab0ca469c2f8a22d.tar.gz CMake-ce1bdec3a4f5fb10a1bd6df3ab0ca469c2f8a22d.tar.bz2 |
Xcode: Fix missing Frameworks search paths
Fixes: #24541
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 78508f3..a93477b 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1563,7 +1563,7 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry) this->OldLinkDirItems.push_back(item.Value); } - if (target->IsFrameworkOnApple() && !this->GlobalGenerator->IsXcode()) { + if (target->IsFrameworkOnApple()) { // Add the framework directory and the framework item itself auto fwDescriptor = this->GlobalGenerator->SplitFrameworkPath( item.Value, cmGlobalGenerator::FrameworkFormat::Extended); @@ -1579,26 +1579,32 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry) // Add the directory portion to the framework search path. this->AddFrameworkPath(fwDescriptor->Directory); } - if (cmHasSuffix(entry.Feature, "FRAMEWORK"_s)) { - this->Items.emplace_back(fwDescriptor->GetLinkName(), ItemIsPath::Yes, - target, - this->FindLibraryFeature(entry.Feature)); - } else { + + if (this->GlobalGenerator->IsXcode()) { this->Items.emplace_back( item, ItemIsPath::Yes, target, - this->FindLibraryFeature( - entry.Feature == DEFAULT ? "__CMAKE_LINK_LIBRARY" : entry.Feature)); + this->FindLibraryFeature(entry.Feature == DEFAULT + ? "__CMAKE_LINK_FRAMEWORK" + : entry.Feature)); + } else { + if (cmHasSuffix(entry.Feature, "FRAMEWORK"_s)) { + this->Items.emplace_back(fwDescriptor->GetLinkName(), ItemIsPath::Yes, + target, + this->FindLibraryFeature(entry.Feature)); + } else { + this->Items.emplace_back( + item, ItemIsPath::Yes, target, + this->FindLibraryFeature(entry.Feature == DEFAULT + ? "__CMAKE_LINK_LIBRARY" + : entry.Feature)); + } } } else { // Now add the full path to the library. this->Items.emplace_back( item, ItemIsPath::Yes, target, this->FindLibraryFeature( - entry.Feature == DEFAULT - ? (target->IsFrameworkOnApple() && this->GlobalGenerator->IsXcode() - ? "__CMAKE_LINK_FRAMEWORK" - : "__CMAKE_LINK_LIBRARY") - : entry.Feature)); + entry.Feature == DEFAULT ? "__CMAKE_LINK_LIBRARY" : entry.Feature)); } } |