summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-09 15:23:54 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-09 15:24:34 (GMT)
commit7710c940097266eb50e094d760848f5591af8cbf (patch)
tree7dfa856a0de20876c10c29b315ebbf557be40d1e /Source/cmLocalGenerator.cxx
parent5e0e78b859860b4763ab64cf6cd20f53cb2cdc7a (diff)
parentce7c100545c6618e4d4263a5b651163974112f94 (diff)
downloadCMake-7710c940097266eb50e094d760848f5591af8cbf.zip
CMake-7710c940097266eb50e094d760848f5591af8cbf.tar.gz
CMake-7710c940097266eb50e094d760848f5591af8cbf.tar.bz2
Merge topic 'pch-tv90'
ce7c100545 PCH: Fix 30s wait for VS2008 when used via -Tv90 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5199
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx28
1 files changed, 20 insertions, 8 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 0ec0757..47931b0 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2574,17 +2574,29 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
this->Makefile->GetSafeDefinition(
cmStrCat("CMAKE_", lang, "_FLAGS_", configUpper));
+ bool editAndContinueDebugInfo =
+ langFlags.find("/ZI") != std::string::npos ||
+ langFlags.find("-ZI") != std::string::npos;
+
+ bool enableDebuggingInformation =
+ langFlags.find("/Zi") != std::string::npos ||
+ langFlags.find("-Zi") != std::string::npos;
+
// MSVC 2008 is producing both .pdb and .idb files with /Zi.
- if ((langFlags.find("/ZI") != std::string::npos ||
- langFlags.find("-ZI") != std::string::npos) ||
- (cmSystemTools::VersionCompare(cmSystemTools::OP_LESS,
- compilerVersion.c_str(),
- "16.0") &&
- compilerId == "MSVC")) {
+ bool msvc2008OrLess =
+ cmSystemTools::VersionCompare(
+ cmSystemTools::OP_LESS, compilerVersion.c_str(), "16.0") &&
+ compilerId == "MSVC";
+ // but not when used via toolset -Tv90
+ if (this->Makefile->GetSafeDefinition(
+ "CMAKE_VS_PLATFORM_TOOLSET") == "v90") {
+ msvc2008OrLess = false;
+ }
+
+ if (editAndContinueDebugInfo || msvc2008OrLess) {
CopyPchCompilePdb(config, target, *ReuseFrom, reuseTarget,
{ ".pdb", ".idb" });
- } else if ((langFlags.find("/Zi") != std::string::npos ||
- langFlags.find("-Zi") != std::string::npos)) {
+ } else if (enableDebuggingInformation) {
CopyPchCompilePdb(config, target, *ReuseFrom, reuseTarget,
{ ".pdb" });
}