diff options
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index c93b140..91fbccc 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -218,15 +218,25 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset( if (vcPlatformToolsetRegex.find(platformToolset) || platformToolset == "Test Toolset"_s) { std::string versionToolset = this->GeneratorToolsetVersion; - cmsys::RegularExpression versionToolsetRegex("^[0-9][0-9]\\.[0-9][0-9]"); + cmsys::RegularExpression versionToolsetRegex( + "^([0-9][0-9])\\.([0-9])[0-9](\\.|$)"); if (versionToolsetRegex.find(versionToolset)) { - versionToolset = cmStrCat('v', versionToolset.erase(2, 1)); + versionToolset = cmStrCat('v', versionToolsetRegex.match(1), + versionToolsetRegex.match(2)); + // Hard-code special cases for toolset versions whose first + // three digits do not match their toolset name. + if (platformToolset == "v143"_s && versionToolset == "v144"_s && + // VS 17.10 toolset v143 version 14.40. + (this->GeneratorToolsetVersion == "14.40"_s || + cmHasLiteralPrefix(this->GeneratorToolsetVersion, "14.40."))) { + versionToolset = "v143"; + } } else { // Version not recognized. Clear it. versionToolset.clear(); } - if (!cmHasPrefix(versionToolset, platformToolset)) { + if (versionToolset != platformToolset) { mf->IssueMessage( MessageType::FATAL_ERROR, cmStrCat("Generator\n" |