Skip to content

Commit e11e71d

Browse files
committed
Make compiler flags for -Werror specific to GNU, Clang, or Intel
1 parent 21c3911 commit e11e71d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ find_package(Boost 1.56)
126126
function(pybind11_enable_warnings target_name)
127127
if(MSVC)
128128
target_compile_options(${target_name} PRIVATE /W4)
129-
else()
129+
elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Intel|Clang)")
130130
target_compile_options(${target_name} PRIVATE -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated)
131131
endif()
132132

133133
if(PYBIND11_WERROR)
134134
if(MSVC)
135135
target_compile_options(${target_name} PRIVATE /WX)
136-
else()
136+
elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Intel|Clang)")
137137
target_compile_options(${target_name} PRIVATE -Werror)
138138
endif()
139139
endif()

0 commit comments

Comments
 (0)