Skip to content

VS: Fix '-T version=14.28' under VS 16.9

Brad King requested to merge brad.king/cmake:vs-toolset-version into master

CMake accepts the toolset version that is default in the current VS version by matching the name later VS versions will use for the SxS props files. It predicts the future name based on the first two components of the current VS version's default toolset. However, this heuristic breaks naming the VS 16.8 toolset version 14.28 under VS 16.9 because the latter's default toolset version is 14.28.29910, which did not increment the second version component (unprecedented in VS).

Fix this by always using the requested version's SxS props file when it exists, even if it matches the first two components of the current VS version's default toolset. Also add a special case for the name VS 16.10 will use for VS 16.9's default toolset, so that it can be used with VS 16.9 too.

Also accept and translate '-T version=' values with three components. The vcvarsall option -vcvars_ver= accepts a three component version, so accept this format for VS toolset selection too.

Fixes: #21922 (closed)
Backport: release

Edited by Brad King

Merge request reports