summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorGusts Kaksis <gusts.kaksis@sonarworks.com>2020-11-04 17:56:29 (GMT)
committerGusts Kaksis <gusts.kaksis@sonarworks.com>2020-11-05 11:48:54 (GMT)
commitbffb17be3d1687f62c43028837a0e2331c997b43 (patch)
tree00790430b828b3332d82ee30f3c8da00574f5b50 /Source
parent39f32f12100a7f06f52cd53875b2a5729e9404a6 (diff)
downloadCMake-bffb17be3d1687f62c43028837a0e2331c997b43.zip
CMake-bffb17be3d1687f62c43028837a0e2331c997b43.tar.gz
CMake-bffb17be3d1687f62c43028837a0e2331c997b43.tar.bz2
Xcode: Inherit target library and framework search paths from project
Xcode has multiple levels of build settings with priority in descending order: 1. Target 2. Project 3. Workspace 4. SDK defaults `CMAKE_XCODE_ATTRIBUTE_*` path variables add these to project level, but linked frameworks and libraries override this in target level. Add the `$(inherited)` macro to keep both in the final list. Fixes: #21387
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e7bbf72..908c182 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3557,6 +3557,8 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
for (auto& libDir : linkSearchPaths) {
libSearchPaths.Add(this->XCodeEscapePath(libDir));
}
+ // Add paths defined in project-wide build settings
+ libSearchPaths.Add("$(inherited)");
this->AppendBuildSettingAttribute(target, "LIBRARY_SEARCH_PATHS",
libSearchPaths.CreateList(),
configName);
@@ -3570,6 +3572,8 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
for (auto& fwDir : frameworkSearchPaths) {
fwSearchPaths.Add(this->XCodeEscapePath(fwDir));
}
+ // Add paths defined in project-wide build settings
+ fwSearchPaths.Add("$(inherited)");
this->AppendBuildSettingAttribute(target, "FRAMEWORK_SEARCH_PATHS",
fwSearchPaths.CreateList(),
configName);