VS: Select latest available Windows SDK version by default

Add policy `CMP0149` to stop preferring SDKs exactly matching
`CMAKE_SYSTEM_VERSION` over the latest SDK.

Fixes: #16202
This commit is contained in:
Brad King
2023-04-03 11:12:18 -04:00
parent b512c53d43
commit f90c8ab54e
7 changed files with 75 additions and 4 deletions

View File

@@ -15,6 +15,9 @@ VS 2015 and above support specification of a Windows SDK version:
* Otherwise, if :variable:`CMAKE_SYSTEM_VERSION` is set to an available
SDK version, that version is selected.
.. versionchanged:: 3.27
This is disabled by policy :policy:`CMP0149`.
* Otherwise, CMake uses the latest Windows SDK version available.
The chosen Windows target version number is provided