diff options
author | Brad King <brad.king@kitware.com> | 2016-12-01 13:51:00 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-12-01 13:51:00 (GMT) |
commit | 7108d4b73d130d7717f1af5bbaa52b1ea3c43b0f (patch) | |
tree | 72573f954c5d3ad85e9da04f57a817caff6b6668 | |
parent | 36588f7b162e74130ac2530f57acca263f1141ca (diff) | |
parent | a4da6fa71dc0e0e6102d4b72f7abee00ac4e4110 (diff) | |
download | CMake-7108d4b73d130d7717f1af5bbaa52b1ea3c43b0f.zip CMake-7108d4b73d130d7717f1af5bbaa52b1ea3c43b0f.tar.gz CMake-7108d4b73d130d7717f1af5bbaa52b1ea3c43b0f.tar.bz2 |
Merge topic 'compile-pdb-default'
a4da6fa7 Ninja,Makefile: Name static library compile PDB files as VS does
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 2e5173d..6906a90 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -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"; + } } } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index e47de97..8090542 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -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"; + } } } |