summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-25 14:00:27 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-02-25 14:00:27 (GMT)
commitf8af218ea148baafcfc3db6ea5ba7389f5ea7206 (patch)
tree492740180ab889a4fcd366ce2e5595cb30b55f57 /Source
parentc842411dc5a2123cdc9d949b67f8421379a4a928 (diff)
parentdc422d271e4504ebab2176e841480861a17d13e1 (diff)
downloadCMake-f8af218ea148baafcfc3db6ea5ba7389f5ea7206.zip
CMake-f8af218ea148baafcfc3db6ea5ba7389f5ea7206.tar.gz
CMake-f8af218ea148baafcfc3db6ea5ba7389f5ea7206.tar.bz2
Merge topic 'vs14-debug-enum-older-toolsets'
dc422d27 VS: Fix VS 2015 .vcxproj debug setting for older toolsets (#15986)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 09d4a90..a664442 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2698,6 +2698,33 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
}
}
+ // 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)
+ {
+ cmGlobalVisualStudio10Generator* gg =
+ static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator);
+ const char* toolset = gg->GetPlatformToolset();
+ if (toolset &&
+ (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");
+ }
+ }
+ }
+ }
+
this->LinkOptions[config] = pOptions.release();
return true;
}