cmGeneratorTarget: disambiguate pch objects for multi-config generators

This commit is contained in:
Ben Boeckel committed 2025-09-02 12:56:23 -04:00
1 parent fe0163cd23
commit b1ccad8651
1 file changed
+5 -1
+5 -1
View File
@@ -3188,8 +3188,12 @@ std::string cmGeneratorTarget::GetPchFile(std::string const& config,
auto* pchSf = this->Makefile->GetOrCreateSource(
pchSource, false, cmSourceFileLocationKind::Known);
pchSf->ResolveFullPath();
std::string cfgSubdir;
if (this->GetGlobalGenerator()->IsMultiConfig()) {
cfgSubdir = cmStrCat(config, '/');
}
pchFile = cmStrCat(
this->GetSupportDirectory(), '/',
this->GetSupportDirectory(), '/', cfgSubdir,
this->LocalGenerator->GetShortObjectFileName(*pchSf), pchExtension);
} else {
pchFile =