summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-16 14:25:04 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-09-16 14:25:14 (GMT)
commited8e860998216216ef74bb93b35404c435a44f26 (patch)
tree80116c50bcf50a474829a2c01d3afd43caefd026 /Source/cmGlobalXCodeGenerator.cxx
parent95d54eef45126ba408426926dfc6e94d852828c0 (diff)
parentd4cc39842e9b912f8b25e2c7329f55bf7b53e5f0 (diff)
downloadCMake-ed8e860998216216ef74bb93b35404c435a44f26.zip
CMake-ed8e860998216216ef74bb93b35404c435a44f26.tar.gz
CMake-ed8e860998216216ef74bb93b35404c435a44f26.tar.bz2
Merge topic 'xcode-lib-dirs'
d4cc39842e Xcode: Do not append per-config suffixes to library search paths Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7672
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 6196861..2c455cf 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) {