summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorGusts Kaksis <gusts.kaksis@sonarworks.com>2020-09-28 18:16:52 (GMT)
committerCraig Scott <craig.scott@crascit.com>2020-10-02 12:13:00 (GMT)
commitce2dee9e5bae37c8117087bb83add075c3c123b4 (patch)
tree51a3e6d9194afd96bbc2e6dbbe9b8a9fd3e7057a /Source/cmGlobalXCodeGenerator.cxx
parent468bcc3291ac3f325b401046b2465d634d8e3947 (diff)
downloadCMake-ce2dee9e5bae37c8117087bb83add075c3c123b4.zip
CMake-ce2dee9e5bae37c8117087bb83add075c3c123b4.tar.gz
CMake-ce2dee9e5bae37c8117087bb83add075c3c123b4.tar.bz2
Xcode: Don't add framework as -framework argument in linker info list
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index acae2b6..f1a1ce6 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3579,8 +3579,16 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
for (auto const& libItem : configItemMap[configName]) {
auto const& libName = *libItem;
if (libName.IsPath) {
- libPaths.Add(this->XCodeEscapePath(libName.Value.Value));
const auto libPath = GetLibraryOrFrameworkPath(libName.Value.Value);
+ if (cmSystemTools::StringEndsWith(libPath.c_str(), ".framework")) {
+ const auto fwName =
+ cmSystemTools::GetFilenameWithoutExtension(libPath);
+ const auto fwDir = cmSystemTools::GetParentDirectory(libPath);
+ libPaths.Add("-F " + this->XCodeEscapePath(fwDir));
+ libPaths.Add("-framework " + fwName);
+ } else {
+ libPaths.Add(this->XCodeEscapePath(libName.Value.Value));
+ }
if ((!libName.Target || libName.Target->IsImported()) &&
IsLinkPhaseLibraryExtension(libPath)) {
// Create file reference for embedding