From f61c64cd1cac7c9a6ec93d63647f332a5915da13 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 4 Dec 2023 08:43:25 -0500 Subject: cmLocalGenerator: prevent scanning of PCH source files --- Source/cmLocalGenerator.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index fe8d502..caac535 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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) { -- cgit v0.12