summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-03-07 15:09:33 (GMT)
committerBrad King <brad.king@kitware.com>2016-03-07 15:09:33 (GMT)
commit15a4afe47a2871b97ae44e0ecbd8623a372a906e (patch)
tree153c2e986c97cd30b614fc6af37062cc62a37af9
parent6e6f4d8f80eb34cfeedb8024af70acb9901597d3 (diff)
parent3aa6fea69c0bd1614e13a67eb23ca033c0fe1795 (diff)
downloadCMake-15a4afe47a2871b97ae44e0ecbd8623a372a906e.zip
CMake-15a4afe47a2871b97ae44e0ecbd8623a372a906e.tar.gz
CMake-15a4afe47a2871b97ae44e0ecbd8623a372a906e.tar.bz2
Merge branch 'vs14-debug-enum-older-toolsets' into release
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 09d4a90..da950be 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2698,6 +2698,34 @@ 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, "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");
+ }
+ }
+ }
+ }
+
this->LinkOptions[config] = pOptions.release();
return true;
}