From b64226f2b4ecee71a471825f55db794e99320f36 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 8 Aug 2025 22:39:31 -0400 Subject: [PATCH] cmGeneratorTarget: only apply short object names when necessary When there is no PCH extension, there is no source file necessary as the source is not compiled at all. --- Source/cmGeneratorTarget.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index dc2bc833fb..0e09644eab 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3183,7 +3183,7 @@ std::string cmGeneratorTarget::GetPchFile(std::string const& config, pchFile = replaceExtension(pchFileObject, pchExtension); } } else { - if (this->GetUseShortObjectNames()) { + if (this->GetUseShortObjectNames() && !pchExtension.empty()) { auto pchSource = this->GetPchSource(config, language, arch); auto* pchSf = this->Makefile->GetOrCreateSource( pchSource, false, cmSourceFileLocationKind::Known);