diff options
author | Brad King <brad.king@kitware.com> | 2023-04-03 15:12:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-04-05 16:06:22 (GMT) |
commit | f90c8ab54ebd751600f525a3e548841e6aa16049 (patch) | |
tree | 2cd8954fd3362418f46407b8f43df4d26ffa4ab7 /Tests | |
parent | b512c53d43b6078c97e06231ccbfa8599a66a4f4 (diff) | |
download | CMake-f90c8ab54ebd751600f525a3e548841e6aa16049.zip CMake-f90c8ab54ebd751600f525a3e548841e6aa16049.tar.gz CMake-f90c8ab54ebd751600f525a3e548841e6aa16049.tar.bz2 |
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
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake | 11 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/VersionExists.cmake | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake index 96c2b6b..ffd105c 100644 --- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake @@ -88,5 +88,16 @@ if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio (1[4567])( 20[0-9][0-9])?$") run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=10.0) unset(RunCMake_GENERATOR_PLATFORM) endforeach() + foreach(expect_version IN LISTS kits) + set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMP0149-OLD-${expect_version}") + run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=${expect_version} -DCMAKE_POLICY_DEFAULT_CMP0149=OLD) + endforeach() + if(kits MATCHES "(^|;)([0-9.]+)$") + set(expect_version "${CMAKE_MATCH_2}") + foreach(test_version IN LISTS kits) + set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMP0149-NEW-${test_version}") + run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=${test_version} -DCMAKE_POLICY_DEFAULT_CMP0149=NEW) + endforeach() + endif() endif() endif() diff --git a/Tests/RunCMake/GeneratorPlatform/VersionExists.cmake b/Tests/RunCMake/GeneratorPlatform/VersionExists.cmake index 0d7a9ba..5369ca0 100644 --- a/Tests/RunCMake/GeneratorPlatform/VersionExists.cmake +++ b/Tests/RunCMake/GeneratorPlatform/VersionExists.cmake @@ -1 +1,4 @@ +cmake_policy(GET CMP0149 cmp0149) +message(STATUS "CMP0149='${cmp0149}'") +message(STATUS "CMAKE_SYSTEM_VERSION='${CMAKE_SYSTEM_VERSION}'") message(STATUS "CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION='${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}'") |