summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio10Generator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 0e02b0a..e3835ff 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -130,6 +130,7 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
this->DefaultNasmFlagTable = cmVS10NASMFlagTable;
this->DefaultRcFlagTable = cmVS10RCFlagTable;
this->Version = VS10;
+ this->PlatformToolsetNeedsDebugEnum = false;
}
bool cmGlobalVisualStudio10Generator::MatchesGeneratorName(
@@ -195,6 +196,24 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
return false;
}
+ if (cmHasLiteralPrefix(this->GetPlatformToolsetString(), "v140")) {
+ // The GenerateDebugInformation link setting for the v140 toolset
+ // in VS 2015 was originally an enum with "No" and "Debug" values,
+ // differing from the "false" and "true" values used in older toolsets.
+ // A VS 2015 update changed it back. Parse the "link.xml" file to
+ // discover which one we need.
+ std::string const link_xml = this->VCTargetsPath + "/1033/link.xml";
+ cmsys::ifstream fin(link_xml.c_str());
+ std::string line;
+ while (fin && cmSystemTools::GetLineFromStream(fin, line)) {
+ if (line.find(" Switch=\"DEBUG\" ") != std::string::npos) {
+ this->PlatformToolsetNeedsDebugEnum =
+ line.find(" Name=\"Debug\" ") != std::string::npos;
+ break;
+ }
+ }
+ }
+
if (this->GeneratorToolsetCuda.empty()) {
// Find the highest available version of the CUDA tools.
std::vector<std::string> cudaTools;