diff options
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 40f3ab5..96649ab 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1792,13 +1792,16 @@ void cmQtAutoGenInitializer::AddGeneratedSource(ConfigString const& filename, // XXX(xcode-per-cfg-src): Drop the Xcode-specific part of the condition // when the Xcode generator supports per-config sources. if (!this->MultiConfig || this->GlobalGen->IsXcode()) { - this->AddGeneratedSource(filename.Default, genVars, prepend); + cmSourceFile* sf = + this->AddGeneratedSource(filename.Default, genVars, prepend); + handleSkipPch(sf); return; } for (auto const& cfg : this->ConfigsList) { std::string const& filenameCfg = filename.Config.at(cfg); // Register source at makefile - this->RegisterGeneratedSource(filenameCfg); + cmSourceFile* sf = this->RegisterGeneratedSource(filenameCfg); + handleSkipPch(sf); // Add source file to target for this configuration. this->GenTarget->AddSource( cmStrCat("$<$<CONFIG:"_s, cfg, ">:"_s, filenameCfg, ">"_s), prepend); @@ -1847,8 +1850,7 @@ void cmQtAutoGenInitializer::AddToSourceGroup(std::string const& fileName, void cmQtAutoGenInitializer::AddCleanFile(std::string const& fileName) { - this->GenTarget->Target->AppendProperty("ADDITIONAL_CLEAN_FILES", fileName, - false); + this->GenTarget->Target->AppendProperty("ADDITIONAL_CLEAN_FILES", fileName); } void cmQtAutoGenInitializer::ConfigFileNames(ConfigString& configString, @@ -2159,3 +2161,18 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars, return true; } + +void cmQtAutoGenInitializer::handleSkipPch(cmSourceFile* sf) +{ + bool skipPch = true; + for (auto const& pair : this->AutogenTarget.Sources) { + if (!pair.first->GetIsGenerated() && + !pair.first->GetProperty("SKIP_PRECOMPILE_HEADERS")) { + skipPch = false; + } + } + + if (skipPch) { + sf->SetProperty("SKIP_PRECOMPILE_HEADERS", "ON"); + } +} |