summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-08-08 18:20:43 (GMT)
committerBrad King <brad.king@kitware.com>2023-08-10 13:57:00 (GMT)
commitae97d82e830c6ddc81808e3f44dad8a47a30bcae (patch)
tree6eb5216786d3167c8ad111d3f0a71cd4b104716b /Tests
parent15ff89654b925b74f074ef7e13ed905c3ec38c4b (diff)
downloadCMake-ae97d82e830c6ddc81808e3f44dad8a47a30bcae.zip
CMake-ae97d82e830c6ddc81808e3f44dad8a47a30bcae.tar.gz
CMake-ae97d82e830c6ddc81808e3f44dad8a47a30bcae.tar.bz2
VS: Teach CMAKE_GENERATOR_PLATFORM to support Windows 8.1 SDK selection
Honor an explicit `version=8.1` field value regardless of the Windows target version. Issue: #25170
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
index 5c1689a..7620b13 100644
--- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
@@ -65,6 +65,16 @@ if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio (1[4567])( 20[0-9][0-9])?$")
file(GLOB kits RELATIVE "${kitsInclude}" "${kitsInclude}/*/um/windows.h")
list(TRANSFORM kits REPLACE "/.*" "")
endif()
+ cmake_host_system_information(RESULT kitsRoot81
+ QUERY WINDOWS_REGISTRY "HKLM/SOFTWARE/Microsoft/Windows Kits/Installed Roots"
+ VALUE "KitsRoot81"
+ VIEW 64_32
+ ERROR_VARIABLE kitsRoot81Error
+ )
+ if(NOT kitsRoot81Error AND EXISTS "${kitsRoot81}/include/um/windows.h")
+ list(PREPEND kits "8.1")
+ endif()
+
if(kits)
message(STATUS "Available Kits: ${kits}")
if(RunCMake_GENERATOR MATCHES "^Visual Studio 14 ")
@@ -93,6 +103,7 @@ 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)