cmLocalGenerator: prevent scanning of PCH source files

This commit is contained in:
Ben Boeckel
2023-12-04 08:43:25 -05:00
parent ea8c37b759
commit f61c64cd1c

View File

@@ -2706,6 +2706,9 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
auto* pch_sf = this->Makefile->GetOrCreateSource(
pchSource, false, cmSourceFileLocationKind::Known);
// PCH sources should never be scanned as they cannot contain C++
// module references.
pch_sf->SetProperty("CXX_SCAN_FOR_MODULES", "0");
if (!this->GetGlobalGenerator()->IsXcode()) {
if (!ReuseFrom) {