Merge topic 'compile-pdb-default'

a4da6fa7 Ninja,Makefile: Name static library compile PDB files as VS does
This commit is contained in:
Brad King 2016-12-01 08:51:00 -05:00 committed by CMake Topic Stage
commit 7108d4b73d
2 changed files with 14 additions and 0 deletions

View File

@ -520,8 +520,15 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
targetFullPathCompilePDB = targetFullPathCompilePDB =
this->GeneratorTarget->GetCompilePDBPath(this->ConfigName); this->GeneratorTarget->GetCompilePDBPath(this->ConfigName);
if (targetFullPathCompilePDB.empty()) { if (targetFullPathCompilePDB.empty()) {
// Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`.
// A trailing slash tells the toolchain to add its default file name.
targetFullPathCompilePDB = targetFullPathCompilePDB =
this->GeneratorTarget->GetSupportDirectory() + "/"; 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";
}
} }
} }

View File

@ -359,7 +359,14 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
compilePdbPath = compilePdbPath =
this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName()); this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName());
if (compilePdbPath.empty()) { 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() + "/"; 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";
}
} }
} }