diff options
author | Brad King <brad.king@kitware.com> | 2024-02-20 15:35:50 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-02-20 15:36:00 (GMT) |
commit | d2df2e94e50a003fc635a1913f70ccc784696f15 (patch) | |
tree | 2aedb1943ee0ad1145df156c7e3f0731a99e7894 /Source | |
parent | aad37338c75dbcabfb50f89053754d45f8032cbe (diff) | |
parent | d256581bb08799741f9a5221396a5b38b44b3f54 (diff) | |
download | CMake-d2df2e94e50a003fc635a1913f70ccc784696f15.zip CMake-d2df2e94e50a003fc635a1913f70ccc784696f15.tar.gz CMake-d2df2e94e50a003fc635a1913f70ccc784696f15.tar.bz2 |
Merge topic 'vs-17.10' into release-3.29
d256581bb0 VS: Fix '-T version=14.40' under VS 17.10 preview 1
3a7fbd04c8 VS: Verify toolset version= field format more strictly
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9271
Diffstat (limited to 'Source')
-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" |