summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-02 14:03:44 (GMT)
committerBrad King <brad.king@kitware.com>2022-11-02 20:57:36 (GMT)
commite1ccab12d7530d4a1004f488cbb5c985f2d27215 (patch)
treeb7b9367b7094bd53d4ac1c2273578b9a76c853a8 /Source
parentb45f9b364382839995c76bc9794bb5ae8fb787b5 (diff)
downloadCMake-e1ccab12d7530d4a1004f488cbb5c985f2d27215.zip
CMake-e1ccab12d7530d4a1004f488cbb5c985f2d27215.tar.gz
CMake-e1ccab12d7530d4a1004f488cbb5c985f2d27215.tar.bz2
Xcode: Restore Swift framework search directories
Previously we selected a single "language for preprocessor" with which to compute both target-wide `GCC_PREPROCESSOR_DEFINITIONS` and `{HEADER,FRAMEWORK}_SEARCH_PATHS`. Since commit c0dd3dd2c1 (Xcode: Evaluate Swift compile definitions separately, 2022-10-25, v3.25.0-rc3~16^2) we never compute `GCC_PREPROCESSOR_DEFINITIONS` for Swift. Therefore we need to select the language for target-wide include and framework directories separately. Fixes: #24116
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx22
1 files changed, 12 insertions, 10 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 67b6e92..e81ce22 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2390,13 +2390,13 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
// Choose a language to use for target-wide preprocessor definitions.
static const char* ppLangs[] = { "CXX", "C", "OBJCXX", "OBJC" };
- std::string langForPreprocessor;
+ std::string langForPreprocessorDefinitions;
if (cm::contains(ppLangs, llang)) {
- langForPreprocessor = llang;
+ langForPreprocessorDefinitions = llang;
} else {
for (const char* l : ppLangs) {
if (languages.count(l)) {
- langForPreprocessor = l;
+ langForPreprocessorDefinitions = l;
break;
}
}
@@ -2424,9 +2424,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
this->AppendDefines(ppDefs, exportMacro->c_str());
}
std::vector<std::string> targetDefines;
- if (!langForPreprocessor.empty()) {
+ if (!langForPreprocessorDefinitions.empty()) {
gtgt->GetCompileDefinitions(targetDefines, configName,
- langForPreprocessor);
+ langForPreprocessorDefinitions);
}
this->AppendDefines(ppDefs, targetDefines);
buildSettings->AddAttribute("GCC_PREPROCESSOR_DEFINITIONS",
@@ -2725,10 +2725,12 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
BuildObjectListOrString sysfdirs(this, true);
const bool emitSystemIncludes = this->XcodeVersion >= 83;
+ // Choose a language to use for target-wide include directories.
+ std::string const& langForIncludes = llang;
std::vector<std::string> includes;
- if (!langForPreprocessor.empty()) {
+ if (!langForIncludes.empty()) {
this->CurrentLocalGenerator->GetIncludeDirectories(
- includes, gtgt, langForPreprocessor, configName);
+ includes, gtgt, langForIncludes, configName);
}
std::set<std::string> emitted;
emitted.insert("/System/Library/Frameworks");
@@ -2741,7 +2743,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
std::string incpath = this->XCodeEscapePath(frameworkDir);
if (emitSystemIncludes &&
gtgt->IsSystemIncludeDirectory(include, configName,
- langForPreprocessor)) {
+ langForIncludes)) {
sysfdirs.Add(incpath);
} else {
fdirs.Add(incpath);
@@ -2751,7 +2753,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
std::string incpath = this->XCodeEscapePath(include);
if (emitSystemIncludes &&
gtgt->IsSystemIncludeDirectory(include, configName,
- langForPreprocessor)) {
+ langForIncludes)) {
sysdirs.Add(incpath);
} else {
dirs.Add(incpath);
@@ -2765,7 +2767,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
std::string incpath = this->XCodeEscapePath(fwDir);
if (emitSystemIncludes &&
gtgt->IsSystemIncludeDirectory(fwDir, configName,
- langForPreprocessor)) {
+ langForIncludes)) {
sysfdirs.Add(incpath);
} else {
fdirs.Add(incpath);