diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/cmPolicies.h | 9 |
2 files changed, 15 insertions, 4 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) { diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index ea25814..4643868 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -427,7 +427,11 @@ class cmMakefile; SELECT( \ POLICY, CMP0141, \ "MSVC debug information format flags are selected by an abstraction.", 3, \ - 25, 0, cmPolicies::WARN) + 25, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0142, \ + "The Xcode generator does not append per-config suffixes to " \ + "library search paths.", \ + 3, 25, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ @@ -464,7 +468,8 @@ class cmMakefile; F(CMP0112) \ F(CMP0113) \ F(CMP0119) \ - F(CMP0131) + F(CMP0131) \ + F(CMP0142) /** \class cmPolicies * \brief Handles changes in CMake behavior and policies |