diff options
author | Brad King <brad.king@kitware.com> | 2019-01-28 15:49:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-28 17:58:21 (GMT) |
commit | 0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc (patch) | |
tree | 3f264f210f2e7ab523433b4f87509e581c7e9110 /Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake | |
parent | 17cef3806d958bd03ec08b925fe585a0cfa204fa (diff) | |
download | CMake-0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc.zip CMake-0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc.tar.gz CMake-0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc.tar.bz2 |
VS: Teach VS 2019 generator to select host tools matching host arch
This generator is new so we can introduce the long-desired behavior
of selecting ``host=x64`` tools by default on x64 hosts.
Diffstat (limited to 'Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake')
-rw-r--r-- | Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
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() |