summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GeneratorToolset
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-01-28 15:49:16 (GMT)
committerBrad King <brad.king@kitware.com>2019-01-28 17:58:21 (GMT)
commit0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc (patch)
tree3f264f210f2e7ab523433b4f87509e581c7e9110 /Tests/RunCMake/GeneratorToolset
parent17cef3806d958bd03ec08b925fe585a0cfa204fa (diff)
downloadCMake-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')
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake13
2 files changed, 14 insertions, 1 deletions
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()