diff options
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index fc5e6e5f18..feea49f40f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2510,12 +2510,12 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target) static const std::array<std::string, 4> langs = { { "C", "CXX", "OBJC", "OBJCXX" } }; - bool haveAnyPch = false; + std::set<std::string> pchLangSet; if (this->GetGlobalGenerator()->IsXcode()) { for (const std::string& lang : langs) { const std::string pchHeader = target->GetPchHeader(config, lang, ""); if (!pchHeader.empty()) { - haveAnyPch = true; + pchLangSet.emplace(lang); } } } @@ -2560,9 +2560,11 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target) const std::string pchHeader = target->GetPchHeader(config, lang, arch); if (pchSource.empty() || pchHeader.empty()) { - if (this->GetGlobalGenerator()->IsXcode() && haveAnyPch) { + if (this->GetGlobalGenerator()->IsXcode() && !pchLangSet.empty()) { for (auto* sf : sources) { - sf->SetProperty("SKIP_PRECOMPILE_HEADERS", "ON"); + if (pchLangSet.find(sf->GetLanguage()) == pchLangSet.end()) { + sf->SetProperty("SKIP_PRECOMPILE_HEADERS", "ON"); + } } } continue; |