diff options
author | Brad King <brad.king@kitware.com> | 2023-08-08 20:43:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-08-10 13:59:25 (GMT) |
commit | 89b611ab3232cdeb4892458bf9d6c3281a8fda00 (patch) | |
tree | c54a6010827a11fefd621612b4145434ee5e68aa /Tests | |
parent | ae97d82e830c6ddc81808e3f44dad8a47a30bcae (diff) | |
download | CMake-89b611ab3232cdeb4892458bf9d6c3281a8fda00.zip CMake-89b611ab3232cdeb4892458bf9d6c3281a8fda00.tar.gz CMake-89b611ab3232cdeb4892458bf9d6c3281a8fda00.tar.bz2 |
VS: Select latest Windows SDK even when targeting Windows 8.1 and below
The policy added by commit f90c8ab54e (VS: Select latest available
Windows SDK version by default, 2023-04-03, v3.27.0-rc1~206^2~1) applied
only when targeting Windows 10+. Apply it to older versions too.
Fixes: #25170
Issue: #16202
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/VersionExists-check.cmake | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake index 7620b13..d8965f7 100644 --- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake @@ -103,7 +103,6 @@ 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() - list(REMOVE_ITEM kits 8.1) 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) @@ -115,6 +114,7 @@ if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio (1[4567])( 20[0-9][0-9])?$") run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=${test_version} -DCMAKE_POLICY_DEFAULT_CMP0149=NEW) endforeach() endif() + list(REMOVE_ITEM kits 8.1) foreach(expect_version IN LISTS kits) set(RunCMake_TEST_VARIANT_DESCRIPTION "-WindowsSDKVersion-${expect_version}") set(ENV{WindowsSDKVersion} "${expect_version}\\") diff --git a/Tests/RunCMake/GeneratorPlatform/VersionExists-check.cmake b/Tests/RunCMake/GeneratorPlatform/VersionExists-check.cmake index 6c3c8e5..62fb278 100644 --- a/Tests/RunCMake/GeneratorPlatform/VersionExists-check.cmake +++ b/Tests/RunCMake/GeneratorPlatform/VersionExists-check.cmake @@ -1,9 +1,13 @@ if(actual_stdout MATCHES "CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION='([^']+)'") set(actual_version "${CMAKE_MATCH_1}") - if(NOT "${actual_version}" STREQUAL "${expect_version}") - set(RunCMake_TEST_FAILED "Actual SDK version '${actual_version}' did not match expected '${expect_version}'") - return() - endif() +elseif(actual_stdout MATCHES "CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=''" AND RunCMake_GENERATOR MATCHES "Visual Studio 1[45] ") + set(actual_version "8.1") else() set(RunCMake_TEST_FAILED "No CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION found in output.") + return() +endif() + +if(NOT "${actual_version}" STREQUAL "${expect_version}") + set(RunCMake_TEST_FAILED "Actual SDK version '${actual_version}' did not match expected '${expect_version}'") + return() endif() |