diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 468ce5c56e..fc5e6e5f18 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2754,7 +2754,7 @@ void cmLocalGenerator::CopyPchCompilePdb( bool stdPipesUTF8 = true; auto configGenex = [&](cm::string_view expr) -> std::string { - if (this->GetGlobalGenerator()->IsVisualStudio()) { + if (this->GetGlobalGenerator()->IsMultiConfig()) { return cmStrCat("$<$:", expr, ">"); } return std::string(expr); @@ -2773,8 +2773,8 @@ void cmLocalGenerator::CopyPchCompilePdb( std::vector no_byproducts; std::vector outputs; - outputs.push_back( - cmStrCat(target_compile_pdb_dir, pdb_prefix, ReuseFrom, ".pdb")); + outputs.push_back(configGenex( + cmStrCat(target_compile_pdb_dir, pdb_prefix, ReuseFrom, ".pdb"))); if (this->GetGlobalGenerator()->IsVisualStudio()) { this->AddCustomCommandToTarget(