diff options
author | Mikko Sivulainen <mikko.sivulainen@supercell.com> | 2022-09-14 11:30:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-09-15 14:27:23 (GMT) |
commit | d4cc39842e9b912f8b25e2c7329f55bf7b53e5f0 (patch) | |
tree | 18de254315c7cabb6ef99430505d3089fbb1d8dd /Source/cmGlobalXCodeGenerator.cxx | |
parent | c3e68020d61ae306261b4f953947483a960edf32 (diff) | |
download | CMake-d4cc39842e9b912f8b25e2c7329f55bf7b53e5f0.zip CMake-d4cc39842e9b912f8b25e2c7329f55bf7b53e5f0.tar.gz CMake-d4cc39842e9b912f8b25e2c7329f55bf7b53e5f0.tar.bz2 |
Xcode: Do not append per-config suffixes to library search paths
Add policy `CMP0142` to remove the automatic addition of the
`$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)` suffix in a compatible way.
Fixes: #21757
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index eb85b47..b4f1279 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3776,14 +3776,20 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) // add the library search paths { BuildObjectListOrString libSearchPaths(this, true); + std::string linkDirs; for (auto const& libDir : cli->GetDirectories()) { if (!libDir.empty() && libDir != "/usr/lib") { - libSearchPaths.Add(this->XCodeEscapePath( - libDir + "/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)")); + cmPolicies::PolicyStatus cmp0142 = + target->GetTarget()->GetPolicyStatusCMP0142(); + if (cmp0142 == cmPolicies::OLD || cmp0142 == cmPolicies::WARN) { + libSearchPaths.Add(this->XCodeEscapePath( + libDir + "/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)")); + } libSearchPaths.Add(this->XCodeEscapePath(libDir)); } } + // Add previously collected paths where to look for libraries // that were added to "Link Binary With Libraries" for (auto& libDir : linkSearchPaths) { |