diff --git a/CMakeLists.txt b/CMakeLists.txt index b73ed7328..f3b86758a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,7 +165,9 @@ CHECK_C_SOURCE_COMPILES( ) set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) -set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror") +if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "XL") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror") +endif() CHECK_C_SOURCE_COMPILES( "#include