Skip to content

Commit a899dd0

Browse files
author
Chuck Atkins
committed
Make compiler flags for -Werror specific to GNU, Clang, or Intel
1 parent 9b02856 commit a899dd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ find_package(Boost 1.56)
124124
function(pybind11_enable_warnings target_name)
125125
if(MSVC)
126126
target_compile_options(${target_name} PRIVATE /W4)
127-
else()
127+
elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Intel|Clang)")
128128
target_compile_options(${target_name} PRIVATE -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated)
129129
endif()
130130

131131
if(PYBIND11_WERROR)
132132
if(MSVC)
133133
target_compile_options(${target_name} PRIVATE /WX)
134-
else()
134+
elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Intel|Clang)")
135135
target_compile_options(${target_name} PRIVATE -Werror)
136136
endif()
137137
endif()

0 commit comments

Comments
 (0)