Xcode: don't set SKIP_PRECOMPILE_HEADERS when source has no language

Resources that should go into "Copy Bundle Resources" build phase are added as source files but don't have an associated language

Fixes: #23821
This commit is contained in:
Andrey Filipenkov
2022-08-11 15:26:30 +03:00
parent 5d0685aa3e
commit 7b2359ac53

View File

@@ -2591,7 +2591,9 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
if (pchSource.empty() || pchHeader.empty()) {
if (this->GetGlobalGenerator()->IsXcode() && !pchLangSet.empty()) {
for (auto* sf : sources) {
if (pchLangSet.find(sf->GetLanguage()) == pchLangSet.end()) {
const auto sourceLanguage = sf->GetLanguage();
if (!sourceLanguage.empty() &&
pchLangSet.find(sourceLanguage) == pchLangSet.end()) {
sf->SetProperty("SKIP_PRECOMPILE_HEADERS", "ON");
}
}