diff options
author | Cristian Adam <cristian.adam@qt.io> | 2020-09-07 17:49:15 (GMT) |
---|---|---|
committer | Cristian Adam <cristian.adam@qt.io> | 2020-09-07 17:49:15 (GMT) |
commit | ce7c100545c6618e4d4263a5b651163974112f94 (patch) | |
tree | 07b50d05c806ac1cf3ee7ce7ca1c1e605b57c240 /Source | |
parent | fff360c60c7e428054306fc0f02126ac7fd34410 (diff) | |
download | CMake-ce7c100545c6618e4d4263a5b651163974112f94.zip CMake-ce7c100545c6618e4d4263a5b651163974112f94.tar.gz CMake-ce7c100545c6618e4d4263a5b651163974112f94.tar.bz2 |
PCH: Fix 30s wait for VS2008 when used via -Tv90
Fixes: #21142
Backport: release
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c15ca7c..d1ab62b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2682,17 +2682,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" }); } |