summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-29 10:12:17 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-29 10:14:59 (GMT)
commit902858367f27e52a3693f8e65573621d9382ac88 (patch)
treebac30974567a2448374be0a11ef3c71c9614a64f /Source/cmGlobalGenerator.cxx
parente647949539f4704a00eddac2357d59ceeb8bc0ca (diff)
parentfa7b041eca021cecfd883cc5796150dae5ad4c5f (diff)
downloadCMake-902858367f27e52a3693f8e65573621d9382ac88.zip
CMake-902858367f27e52a3693f8e65573621d9382ac88.tar.gz
CMake-902858367f27e52a3693f8e65573621d9382ac88.tar.bz2
Merge branch 'backport-3.16-pch-fix-bad-ClearSourcesCache'
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 6a2d4c7..238097d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1609,7 +1609,23 @@ bool cmGlobalGenerator::AddAutomaticSources()
continue;
}
lg->AddUnityBuild(gt.get());
- lg->AddPchDependencies(gt.get());
+ // Targets that re-use a PCH are handled below.
+ if (!gt->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM")) {
+ lg->AddPchDependencies(gt.get());
+ }
+ }
+ }
+ for (const auto& lg : this->LocalGenerators) {
+ for (const auto& gt : lg->GetGeneratorTargets()) {
+ if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
+ gt->GetType() == cmStateEnums::UTILITY ||
+ gt->GetType() == cmStateEnums::GLOBAL_TARGET) {
+ continue;
+ }
+ // Handle targets that re-use a PCH from an above-handled target.
+ if (gt->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM")) {
+ lg->AddPchDependencies(gt.get());
+ }
}
}
// The above transformations may have changed the classification of sources.