summaryrefslogtreecommitdiffstats
path: root/Tests/IncludeDirectories/CMakeLists.txt
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2021-06-02 23:22:35 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2021-06-17 18:02:52 (GMT)
commit5a5c85dffd72972987cb542a4b6c9e606920cbb5 (patch)
tree1f975d56f02ebd08830687ec9326930c1d10339a /Tests/IncludeDirectories/CMakeLists.txt
parent399a3204bb2d198cc660cd83e0de39ad95658498 (diff)
downloadCMake-5a5c85dffd72972987cb542a4b6c9e606920cbb5.zip
CMake-5a5c85dffd72972987cb542a4b6c9e606920cbb5.tar.gz
CMake-5a5c85dffd72972987cb542a4b6c9e606920cbb5.tar.bz2
Tests/IncludeDirectories: support MSVC in system include tests
Diffstat (limited to 'Tests/IncludeDirectories/CMakeLists.txt')
-rw-r--r--Tests/IncludeDirectories/CMakeLists.txt23
1 files changed, 15 insertions, 8 deletions
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt
index 0f0f139..4c488e6 100644
--- a/Tests/IncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/CMakeLists.txt
@@ -3,17 +3,24 @@ project(IncludeDirectories)
if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.4)
OR (CMAKE_C_COMPILER_ID STREQUAL Clang AND NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
- OR CMAKE_C_COMPILER_ID STREQUAL AppleClang)
+ OR CMAKE_C_COMPILER_ID STREQUAL AppleClang
+ OR ("x${CMAKE_C_COMPILER_ID}" STREQUAL "xMSVC" AND
+ CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "19.29.30036.3" AND
+ NOT CMAKE_GENERATOR MATCHES "Visual Studio")) # No support for VS generators yet.
AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles"
OR CMAKE_GENERATOR STREQUAL "Ninja"
OR (CMAKE_GENERATOR STREQUAL "Xcode" AND NOT XCODE_VERSION VERSION_LESS 6.0)))
- include(CheckCXXCompilerFlag)
- check_cxx_compiler_flag(-Wunused-variable run_sys_includes_test)
- if(run_sys_includes_test)
- # The Bullseye wrapper appears to break the -isystem effect.
- execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE out ERROR_VARIABLE out)
- if("x${out}" MATCHES "Bullseye")
- set(run_sys_includes_test 0)
+ if ("x${CMAKE_C_COMPILER_ID}" STREQUAL "xMSVC")
+ set(run_sys_includes_test 1)
+ else ()
+ include(CheckCXXCompilerFlag)
+ check_cxx_compiler_flag(-Wunused-variable run_sys_includes_test)
+ if(run_sys_includes_test)
+ # The Bullseye wrapper appears to break the -isystem effect.
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE out ERROR_VARIABLE out)
+ if("x${out}" MATCHES "Bullseye")
+ set(run_sys_includes_test 0)
+ endif()
endif()
endif()
if (run_sys_includes_test)