xcode: add support for xcconfig files

Fixes: #18420
This commit is contained in:
Gregor Jasny
2022-03-24 22:01:09 +01:00
parent 183b6bbf51
commit 53ca6edd8a
18 changed files with 189 additions and 0 deletions
+20
View File
@@ -6,6 +6,7 @@
#include <ostream>
#include <utility>
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalXCodeGenerator.h"
#include "cmMakefile.h"
@@ -134,3 +135,22 @@ void cmLocalXCodeGenerator::ComputeObjectFilenames(
si.second = objectName;
}
}
void cmLocalXCodeGenerator::AddXCConfigSources(cmGeneratorTarget* target)
{
auto xcconfig = target->GetProperty("XCODE_XCCONFIG");
if (!xcconfig) {
return;
}
auto configs = target->Makefile->GetGeneratorConfigs(
cmMakefile::IncludeEmptyConfig);
for (auto& config : configs) {
auto file = cmGeneratorExpression::Evaluate(
xcconfig,
this, config);
if (!file.empty()) {
target->AddSource(file);
}
}
}