mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 15:10:20 -06:00
Ninja,Makefile: Name static library compile PDB files as VS does
Change the default compile PDB file name for static libraries to match the Visual Studio default of using the logical target name. This may be incompatible with existing behavior but `COMPILE_PDB_NAME` documents that the default is unspecified. Projects depending on a particular name should set the property. Closes: #16438
This commit is contained in:
@@ -520,8 +520,15 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
|
||||
targetFullPathCompilePDB =
|
||||
this->GeneratorTarget->GetCompilePDBPath(this->ConfigName);
|
||||
if (targetFullPathCompilePDB.empty()) {
|
||||
// Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`.
|
||||
// A trailing slash tells the toolchain to add its default file name.
|
||||
targetFullPathCompilePDB =
|
||||
this->GeneratorTarget->GetSupportDirectory() + "/";
|
||||
if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
|
||||
// Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`.
|
||||
targetFullPathCompilePDB += this->GeneratorTarget->GetName();
|
||||
targetFullPathCompilePDB += ".pdb";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -359,7 +359,14 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
|
||||
compilePdbPath =
|
||||
this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName());
|
||||
if (compilePdbPath.empty()) {
|
||||
// Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`.
|
||||
// A trailing slash tells the toolchain to add its default file name.
|
||||
compilePdbPath = this->GeneratorTarget->GetSupportDirectory() + "/";
|
||||
if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
|
||||
// Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`.
|
||||
compilePdbPath += this->GeneratorTarget->GetName();
|
||||
compilePdbPath += ".pdb";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user