diff options
author | Brad King <brad.king@kitware.com> | 2019-01-29 14:05:44 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-29 14:05:51 (GMT) |
commit | fa7077e7411f4f85724deae3427acb29be729567 (patch) | |
tree | 5fff6f43fcc8d2c0efd593df43240fd3e243972d /Tests | |
parent | eeb34232fc2b76dc8b9bde25b2ca696d91b51b5a (diff) | |
parent | 0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc (diff) | |
download | CMake-fa7077e7411f4f85724deae3427acb29be729567.zip CMake-fa7077e7411f4f85724deae3427acb29be729567.tar.gz CMake-fa7077e7411f4f85724deae3427acb29be729567.tar.bz2 |
Merge topic 'vs-host-arch'
0fd742a6ff VS: Teach VS 2019 generator to select host tools matching host arch
17cef3806d VS: Add support for explicit 32-bit toolset selection via host=x86
bf774e521b VS: Remove stray semicolons from VS 2019 implementation
142e67eac6 VS: Use internal abstraction for VCTargetsPath host arch
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2870
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake | 13 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64-stdout.txt (renamed from Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly-stdout.txt) | 0 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64.cmake (renamed from Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake) | 0 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake | 2 |
8 files changed, 24 insertions, 5 deletions
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt index 164d3aa..7067423 100644 --- a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt @@ -5,6 +5,6 @@ CMake Error at CMakeLists.txt:[0-9]+ \(project\): given toolset specification - Test Toolset,host=x64,host=x64 + Test Toolset,host=x64,host=x86 that contains duplicate field key 'host'\.$ diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake index ccf58b4..ef8fd25 100644 --- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake @@ -16,14 +16,16 @@ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]") set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64") run_cmake(TestToolsetHostArchBoth) set(RunCMake_GENERATOR_TOOLSET ",host=x64") - run_cmake(TestToolsetHostArchOnly) + run_cmake(TestToolsetHostArchOnly_x64) set(RunCMake_GENERATOR_TOOLSET "host=x64") - run_cmake(TestToolsetHostArchOnly) + run_cmake(TestToolsetHostArchOnly_x64) + set(RunCMake_GENERATOR_TOOLSET "host=x86") + run_cmake(TestToolsetHostArchOnly_x86) set(RunCMake_GENERATOR_TOOLSET "Test Toolset") run_cmake(TestToolsetHostArchNone) set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x65") run_cmake(BadToolsetHostArch) - set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x64") + set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x86") run_cmake(BadToolsetHostArchTwice) if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[56]") set(RunCMake_GENERATOR_TOOLSET "Test Toolset,version=Test Toolset Version") diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt index 576b40c..e5e6c8d 100644 --- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt @@ -1,2 +1,2 @@ -- CMAKE_VS_PLATFORM_TOOLSET='Test Toolset' --- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='' +-- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='.*' diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake index 26926f9..085bb6b 100644 --- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake @@ -1,2 +1,15 @@ message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'") message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}'") + +if(CMAKE_GENERATOR MATCHES "Visual Studio 1[6]") + cmake_host_system_information(RESULT is_64_bit QUERY IS_64BIT) + if(is_64_bit) + if(NOT "${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" STREQUAL "x64") + message(FATAL_ERROR "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE is not 'x64' as expected.") + endif() + endif() +else() + if(NOT "${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" STREQUAL "") + message(FATAL_ERROR "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE is not empty as expected.") + endif() +endif() diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64-stdout.txt index 8271bd4..8271bd4 100644 --- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly-stdout.txt +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64-stdout.txt diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64.cmake index 26926f9..26926f9 100644 --- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64.cmake diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt new file mode 100644 index 0000000..c7293dc --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt @@ -0,0 +1,2 @@ +-- CMAKE_VS_PLATFORM_TOOLSET='v[0-9]+' +-- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='x86' diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake new file mode 100644 index 0000000..26926f9 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake @@ -0,0 +1,2 @@ +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'") +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}'") |