diff options
author | Brad King <brad.king@kitware.com> | 2023-08-08 20:03:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-08-10 13:34:50 (GMT) |
commit | 15ff89654b925b74f074ef7e13ed905c3ec38c4b (patch) | |
tree | 948aea4dc32ba8c5294590c39e0ad81a498b2f99 /Tests | |
parent | bba1a23da9d64c4ef8d68d22af7b5c93727b66a7 (diff) | |
download | CMake-15ff89654b925b74f074ef7e13ed905c3ec38c4b.zip CMake-15ff89654b925b74f074ef7e13ed905c3ec38c4b.tar.gz CMake-15ff89654b925b74f074ef7e13ed905c3ec38c4b.tar.bz2 |
VS: Teach CMAKE_GENERATOR_PLATFORM to use Windows 10 SDKs for older versions
Honor an explicit `version=` field selecting a Windows 10 SDK regardless
of the Windows target version.
Issue: #25170
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/BadVersionMissing-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/BadVersionPlatform-stderr.txt | 19 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/BadVersionPre2019-result.txt (renamed from Tests/RunCMake/GeneratorPlatform/BadVersionPlatform-result.txt) | 0 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/BadVersionPre2019-stderr.txt | 11 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/BadVersionPre2019.cmake (renamed from Tests/RunCMake/GeneratorPlatform/BadVersionPlatform.cmake) | 0 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported-stderr.txt | 11 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake | 12 |
9 files changed, 33 insertions, 24 deletions
diff --git a/Tests/RunCMake/GeneratorPlatform/BadVersionMissing-stderr.txt b/Tests/RunCMake/GeneratorPlatform/BadVersionMissing-stderr.txt index d82eb0b..41e94f3 100644 --- a/Tests/RunCMake/GeneratorPlatform/BadVersionMissing-stderr.txt +++ b/Tests/RunCMake/GeneratorPlatform/BadVersionMissing-stderr.txt @@ -6,6 +6,6 @@ given platform specification with - version=1\.2\.3\.4 + version=10\.0\.0\.0 field, but no Windows SDK with that version was found\.$ diff --git a/Tests/RunCMake/GeneratorPlatform/BadVersionPlatform-stderr.txt b/Tests/RunCMake/GeneratorPlatform/BadVersionPlatform-stderr.txt deleted file mode 100644 index d3c62e3..0000000 --- a/Tests/RunCMake/GeneratorPlatform/BadVersionPlatform-stderr.txt +++ /dev/null @@ -1,19 +0,0 @@ -^CMake Error at CMakeLists.txt:[0-9]+ \(project\): - Generator - - Visual Studio [^ -]+ - - given platform specification (containing a - - version=8\.1 - - field\. The version field is not supported when targeting - - Windows 8\.1( - - with the Windows 8\.1 SDK installed\.)?|with - - version=8\.1 - - field, but no Windows SDK with that version was found\.)$ diff --git a/Tests/RunCMake/GeneratorPlatform/BadVersionPlatform-result.txt b/Tests/RunCMake/GeneratorPlatform/BadVersionPre2019-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/GeneratorPlatform/BadVersionPlatform-result.txt +++ b/Tests/RunCMake/GeneratorPlatform/BadVersionPre2019-result.txt diff --git a/Tests/RunCMake/GeneratorPlatform/BadVersionPre2019-stderr.txt b/Tests/RunCMake/GeneratorPlatform/BadVersionPre2019-stderr.txt new file mode 100644 index 0000000..649b89d --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/BadVersionPre2019-stderr.txt @@ -0,0 +1,11 @@ +^CMake Error at CMakeLists.txt:[0-9]+ \(project\): + Generator + + Visual Studio [^ +]+ + + given platform specification containing a + + version=10\.0 + + field\. The value 10\.0 is only supported by VS 2019 and above\.$ diff --git a/Tests/RunCMake/GeneratorPlatform/BadVersionPlatform.cmake b/Tests/RunCMake/GeneratorPlatform/BadVersionPre2019.cmake index 2fc38e5..2fc38e5 100644 --- a/Tests/RunCMake/GeneratorPlatform/BadVersionPlatform.cmake +++ b/Tests/RunCMake/GeneratorPlatform/BadVersionPre2019.cmake diff --git a/Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported-result.txt b/Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported-stderr.txt b/Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported-stderr.txt new file mode 100644 index 0000000..c165267 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported-stderr.txt @@ -0,0 +1,11 @@ +^CMake Error at CMakeLists.txt:[0-9]+ \(project\): + Generator + + Visual Studio [^ +]+ + + given platform specification containing a + + version=1\.2\.3\.4 + + field with unsupported value\.$ diff --git a/Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported.cmake b/Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported.cmake new file mode 100644 index 0000000..2fc38e5 --- /dev/null +++ b/Tests/RunCMake/GeneratorPlatform/BadVersionUnsupported.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR "This should not be reached!") diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake index 9718ca9..5c1689a 100644 --- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake @@ -36,12 +36,16 @@ if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio (1[4567])( 20[0-9][0-9])?$") run_cmake(BadFieldUnknown) set(RunCMake_GENERATOR_PLATFORM "version=") run_cmake(BadVersionEmpty) - set(RunCMake_GENERATOR_PLATFORM "version=1.2.3.4") + set(RunCMake_GENERATOR_PLATFORM "version=10.0.0.0") run_cmake(BadVersionMissing) - set(RunCMake_GENERATOR_PLATFORM "version=8.1") - run_cmake_with_options(BadVersionPlatform -DCMAKE_SYSTEM_VERSION=8.1) + set(RunCMake_GENERATOR_PLATFORM "version=1.2.3.4") + run_cmake(BadVersionUnsupported) - if(NOT RunCMake_GENERATOR MATCHES "^Visual Studio (1[45]) ") + if(RunCMake_GENERATOR MATCHES "^Visual Studio (1[45]) ") + set(RunCMake_GENERATOR_PLATFORM "version=10.0") + run_cmake(BadVersionPre2019) + unset(RunCMake_GENERATOR_PLATFORM) + else() set(expect_version "10.0") set(RunCMake_GENERATOR_PLATFORM "version=${expect_version}") set(RunCMake_TEST_VARIANT_DESCRIPTION "-${expect_version}") |