diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2022-07-13 22:28:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-08-16 17:35:36 (GMT) |
commit | 61acaa12af7952f6eaae77b98f2c21630dc2d64d (patch) | |
tree | 1949dc6ce70fa69a88ca52ca635b7611f5ed412f | |
parent | 5b949bbb9114379120c29134b5effd77e39dd134 (diff) | |
download | CMake-61acaa12af7952f6eaae77b98f2c21630dc2d64d.zip CMake-61acaa12af7952f6eaae77b98f2c21630dc2d64d.tar.gz CMake-61acaa12af7952f6eaae77b98f2c21630dc2d64d.tar.bz2 |
xcode: Don't set INSTALL_PATH unless target is SHARED_LIBRARY
An empty INSTALL_PATH will confuse Xcode, resulting in the archive
action producing archives that can not be uploaded to the App Store.
The logic to pull out a install_name_dir only applies to
SHARED_LIBRARY targets, so we can skip the setting of the
property for all other targets.
There might be cases where the INSTALL_PATH code path will also
end up setting an empty INSTALL_PATH, but it's unclear whether
this is a problem, so to keep the patch minimal the existing
code is left as is.
Fixes: #15183
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 70a379e..7523662 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2894,8 +2894,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, } // Create the INSTALL_PATH attribute. - std::string install_name_dir; if (gtgt->GetType() == cmStateEnums::SHARED_LIBRARY) { + std::string install_name_dir; // Get the install_name directory for the build tree. install_name_dir = gtgt->GetInstallNameDirForBuildTree(configName); // Xcode doesn't create the correct install_name in some cases. @@ -2917,9 +2917,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, extraLinkOptions += " -install_name "; extraLinkOptions += XCodeEscapePath(install_name); } + buildSettings->AddAttribute("INSTALL_PATH", + this->CreateString(install_name_dir)); } - buildSettings->AddAttribute("INSTALL_PATH", - this->CreateString(install_name_dir)); // Create the LD_RUNPATH_SEARCH_PATHS cmComputeLinkInformation* pcli = gtgt->GetLinkInformation(configName); |