summaryrefslogtreecommitdiffstats
path: root/Tests/IncludeDirectories/SystemIncludeDirectories
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/SystemIncludeDirectories
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/SystemIncludeDirectories')
-rw-r--r--Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
index 7874d5e..a746a68 100644
--- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
@@ -7,7 +7,11 @@ add_library(systemlib systemlib.cpp)
target_include_directories(systemlib PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/systemlib")
function (apply_error_flags target)
- target_compile_options(${target} PRIVATE -Werror=unused-variable)
+ if (MSVC)
+ target_compile_options(${target} PRIVATE /we4101)
+ else ()
+ target_compile_options(${target} PRIVATE -Werror=unused-variable)
+ endif ()
endfunction ()
add_library(upstream upstream.cpp)
@@ -65,7 +69,11 @@ macro(do_try_compile error_option)
LINK_LIBRARIES iface
)
if (${error_option} STREQUAL WITH_ERROR)
- list(APPEND TC_ARGS COMPILE_DEFINITIONS -Werror=unused-variable)
+ if (MSVC)
+ list(APPEND TC_ARGS COMPILE_DEFINITIONS /we4101)
+ else ()
+ list(APPEND TC_ARGS COMPILE_DEFINITIONS -Werror=unused-variable)
+ endif ()
endif()
try_compile(${TC_ARGS})
endmacro()