mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 19:43:23 +08:00
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
This commit is contained in:
@@ -3557,6 +3557,8 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
|
|||||||
for (auto& libDir : linkSearchPaths) {
|
for (auto& libDir : linkSearchPaths) {
|
||||||
libSearchPaths.Add(this->XCodeEscapePath(libDir));
|
libSearchPaths.Add(this->XCodeEscapePath(libDir));
|
||||||
}
|
}
|
||||||
|
// Add paths defined in project-wide build settings
|
||||||
|
libSearchPaths.Add("$(inherited)");
|
||||||
this->AppendBuildSettingAttribute(target, "LIBRARY_SEARCH_PATHS",
|
this->AppendBuildSettingAttribute(target, "LIBRARY_SEARCH_PATHS",
|
||||||
libSearchPaths.CreateList(),
|
libSearchPaths.CreateList(),
|
||||||
configName);
|
configName);
|
||||||
@@ -3570,6 +3572,8 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
|
|||||||
for (auto& fwDir : frameworkSearchPaths) {
|
for (auto& fwDir : frameworkSearchPaths) {
|
||||||
fwSearchPaths.Add(this->XCodeEscapePath(fwDir));
|
fwSearchPaths.Add(this->XCodeEscapePath(fwDir));
|
||||||
}
|
}
|
||||||
|
// Add paths defined in project-wide build settings
|
||||||
|
fwSearchPaths.Add("$(inherited)");
|
||||||
this->AppendBuildSettingAttribute(target, "FRAMEWORK_SEARCH_PATHS",
|
this->AppendBuildSettingAttribute(target, "FRAMEWORK_SEARCH_PATHS",
|
||||||
fwSearchPaths.CreateList(),
|
fwSearchPaths.CreateList(),
|
||||||
configName);
|
configName);
|
||||||
|
Reference in New Issue
Block a user