summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-10-16 17:23:23 (GMT)
committerBrad King <brad.king@kitware.com>2019-10-17 14:29:31 (GMT)
commit797689ab35c6f1edc37b120804e348b03ce7b161 (patch)
tree45f9980d83280112e450ec768efd9d589933451b /Source/cmMakefileTargetGenerator.cxx
parent0b10b3ed6b3ee644a44414d8b5c205d94a967c12 (diff)
downloadCMake-797689ab35c6f1edc37b120804e348b03ce7b161.zip
CMake-797689ab35c6f1edc37b120804e348b03ce7b161.tar.gz
CMake-797689ab35c6f1edc37b120804e348b03ce7b161.tar.bz2
PCH: Fix Makefile dependencies to rebuild PCH on header changes
Teach the Makefile generator to scan the implicit dependencies of PCH creation. When a header named by `target_precompile_headers` changes the corresponding PCH must be rebuilt and all consumers recompiled. Fixes: #19830
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index e252dcd..767f4e0 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -458,10 +458,14 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
const std::string pchSource =
this->GeneratorTarget->GetPchSource(config, lang);
if (!pchSource.empty() && !source.GetProperty("SKIP_PRECOMPILE_HEADERS")) {
- depends.push_back(this->GeneratorTarget->GetPchHeader(config, lang));
+ std::string const& pchHeader =
+ this->GeneratorTarget->GetPchHeader(config, lang);
+ depends.push_back(pchHeader);
if (source.GetFullPath() != pchSource) {
depends.push_back(this->GeneratorTarget->GetPchFile(config, lang));
}
+ this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, lang,
+ objFullPath, pchHeader);
}
std::string relativeObj =