summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-06-29 13:48:52 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-06-29 13:49:01 (GMT)
commita9b88ffdfccebcbf4c565378722812b19c847bbb (patch)
tree8c52e054f1c4e8c53b49bf2410c38f506d5171ac /Source/cmVisualStudio10TargetGenerator.cxx
parentaaa545f867a69d959305c1be455b4a92d0922b1c (diff)
parent7ba27e364fcf6a941590600d7fb1d304bd462e05 (diff)
downloadCMake-a9b88ffdfccebcbf4c565378722812b19c847bbb.zip
CMake-a9b88ffdfccebcbf4c565378722812b19c847bbb.tar.gz
CMake-a9b88ffdfccebcbf4c565378722812b19c847bbb.tar.bz2
Merge topic 'vs-link-debug-flags'
7ba27e36 VS: Add v140 and v141 flag table entries for /DEBUG:NONE and /DEBUG:FULL ae44496e VS: Fix GenerateDebugInformation values for v140 and v141 toolsets 27bef160 VS: Fix GenerateDebugInformation flag map text for v141 toolsets 17a397c2 VS: Split link flag table between v140 and v141 toolsets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1002
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx37
1 files changed, 9 insertions, 28 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index b45b5f8..e4a4d6f 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -17,8 +17,6 @@
#include "cm_auto_ptr.hxx"
-static std::string const kWINDOWS_7_1_SDK = "Windows7.1SDK";
-
static std::string cmVS10EscapeXML(std::string arg)
{
cmSystemTools::ReplaceString(arg, "&", "&amp;");
@@ -3232,12 +3230,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
linkOptions.AddFlag("StackReserveSize", stackVal);
}
- if (this->LocalGenerator->GetVersion() >=
- cmGlobalVisualStudioGenerator::VS14) {
- linkOptions.AddFlag("GenerateDebugInformation", "No");
- } else {
- linkOptions.AddFlag("GenerateDebugInformation", "false");
- }
+ linkOptions.AddFlag("GenerateDebugInformation", "false");
std::string pdb = this->GeneratorTarget->GetPDBDirectory(config.c_str());
pdb += "/";
@@ -3284,26 +3277,14 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
"%(IgnoreSpecificDefaultLibraries)");
}
- // Hack to fix flag version selection in a common use case.
- // FIXME: Select flag table based on toolset instead of VS version.
- if (this->LocalGenerator->GetVersion() >=
- cmGlobalVisualStudioGenerator::VS14) {
- const char* toolset = gg->GetPlatformToolset();
- if (toolset &&
- (toolset == kWINDOWS_7_1_SDK || /* clang-format please break here */
- cmHasLiteralPrefix(toolset, "v80") ||
- cmHasLiteralPrefix(toolset, "v90") ||
- cmHasLiteralPrefix(toolset, "v100") ||
- cmHasLiteralPrefix(toolset, "v110") ||
- cmHasLiteralPrefix(toolset, "v120"))) {
- if (const char* debug =
- linkOptions.GetFlag("GenerateDebugInformation")) {
- // Convert value from enumeration back to boolean for older toolsets.
- if (strcmp(debug, "No") == 0) {
- linkOptions.AddFlag("GenerateDebugInformation", "false");
- } else if (strcmp(debug, "Debug") == 0) {
- linkOptions.AddFlag("GenerateDebugInformation", "true");
- }
+ // VS 2015 without all updates has a v140 toolset whose
+ // GenerateDebugInformation expects No/Debug instead of false/true.
+ if (gg->GetPlatformToolsetNeedsDebugEnum()) {
+ if (const char* debug = linkOptions.GetFlag("GenerateDebugInformation")) {
+ if (strcmp(debug, "false") == 0) {
+ linkOptions.AddFlag("GenerateDebugInformation", "No");
+ } else if (strcmp(debug, "true") == 0) {
+ linkOptions.AddFlag("GenerateDebugInformation", "Debug");
}
}
}