It checks VS_PLATFORM_TOOLSET_VERSION but never uses the value, it uses VS_TOOLSET_VERSION instead. This change switches to use VS_PLATFORM_TOOLSET_VERSION (which aligns with CMake's CMAKE_VS_PLATFORM_TOOLSET_VERSION), and then sets CMAKE_VS_PLATFORM_TOOLSET_VERSION with the resolved value.
At the minute VS_PLATFORM_TOOLSET_VERSION has to be an exact match - #79 tracks adding support for approximate matches, like vcvarsall.bat does.
Windows.MSVC.toolchain.cmake
has incorrect logic for configuring the toolset version to use:https://github.com/MarkSchofield/WindowsToolchain/blob/70d0c2bb086534565e4193ce034fe38588a4b932/Windows.MSVC.toolchain.cmake#L134C1-L140C83
It checks
VS_PLATFORM_TOOLSET_VERSION
but never uses the value, it usesVS_TOOLSET_VERSION
instead. This change switches to useVS_PLATFORM_TOOLSET_VERSION
(which aligns with CMake's CMAKE_VS_PLATFORM_TOOLSET_VERSION), and then setsCMAKE_VS_PLATFORM_TOOLSET_VERSION
with the resolved value.At the minute
VS_PLATFORM_TOOLSET_VERSION
has to be an exact match - #79 tracks adding support for approximate matches, likevcvarsall.bat
does.This fixes #78.