diff options
author | Zsolt Parragi <zsolt.parragi@cancellar.hu> | 2019-07-06 12:56:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-09 15:30:25 (GMT) |
commit | 417eb5739a35a57bc345bf32c56c80d13e33b292 (patch) | |
tree | 7a764345fde7e35e565d8d3ff4d42409938e49e1 /Tests | |
parent | f56393f0bd4d54db7885e89e8019c5e790bd6aa6 (diff) | |
download | CMake-417eb5739a35a57bc345bf32c56c80d13e33b292.zip CMake-417eb5739a35a57bc345bf32c56c80d13e33b292.tar.gz CMake-417eb5739a35a57bc345bf32c56c80d13e33b292.tar.bz2 |
Tests: fix some Clang failures on Windows
* Execute MSVCRuntimeLibrary tests for GNU command line mode Clang on
Windows using the MSVC ABI
* Assembler tests should be executed with the Ninja generator
* Assembler tests shouldn't be executed with clang-cl
* Fixed a condition in the Preprocess test for clang-cl
* Adjusted the conditions on some MSVC specific tests
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Assembler/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/PDBDirectoryAndName/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/Preprocess/CMakeLists.txt | 7 |
4 files changed, 14 insertions, 8 deletions
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index fb17ebb..21b265c 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -7,9 +7,10 @@ set(SRCS) # (at least) the following toolchains can process assembler files directly # and also generate assembler files from C: -if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode" AND +if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode|Ninja" AND NOT CMAKE_OSX_ARCHITECTURES) - if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND UNIX)) + if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND UNIX) + AND NOT (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")) set(C_FLAGS "${CMAKE_C_FLAGS}") separate_arguments(C_FLAGS) if(CMAKE_OSX_SYSROOT AND CMAKE_C_SYSROOT_FLAG AND NOT ";${C_FLAGS};" MATCHES ";${CMAKE_C_SYSROOT_FLAG};") diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index b8b7e21..d951316 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1877,9 +1877,11 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH endif () list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir") - if(MSVC) - ADD_TEST_MACRO(ForceInclude foo) + if(MSVC OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_SIMULATE_ID STREQUAL "MSVC")) ADD_TEST_MACRO(PDBDirectoryAndName myexe) + if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" OR NOT "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") + ADD_TEST_MACRO(ForceInclude foo) + endif() if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") ADD_TEST_MACRO(PrecompiledHeader foo) endif() diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt index 6d8d6cc..44194ca 100644 --- a/Tests/PDBDirectoryAndName/CMakeLists.txt +++ b/Tests/PDBDirectoryAndName/CMakeLists.txt @@ -3,8 +3,8 @@ cmake_policy(SET CMP0054 NEW) project(PDBDirectoryAndName C) # Make sure the proper compiler is in use. -if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") - message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC or Intel") +if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC, Clang or Intel") endif() # Intel 11.1 does not support /Fd but Intel 14.0 does. diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index 588af03..bce1b3f 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -29,7 +29,10 @@ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") set(PP_VS 1) endif() if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND - "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" AND + "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") + set(CLANG_MSVC_WINDOWS 1) +endif() +if(CLANG_MSVC_WINDOWS AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") set(CLANG_GNULIKE_WINDOWS 1) endif() @@ -106,7 +109,7 @@ endif() set(EXPR_OP1 "/") if((NOT MSVC OR PP_NMAKE) AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND - NOT CLANG_GNULIKE_WINDOWS) + NOT CLANG_MSVC_WINDOWS) # MSVC cl, Intel icl: % # When the cl compiler is invoked from the command line then % must # be written %% (to distinguish from %ENV% syntax). However cl does |