Commit e11e71d8 by Wenzel Jakob

Make compiler flags for -Werror specific to GNU, Clang, or Intel

parent 21c3911b
...@@ -126,14 +126,14 @@ find_package(Boost 1.56) ...@@ -126,14 +126,14 @@ find_package(Boost 1.56)
function(pybind11_enable_warnings target_name) function(pybind11_enable_warnings target_name)
if(MSVC) if(MSVC)
target_compile_options(${target_name} PRIVATE /W4) target_compile_options(${target_name} PRIVATE /W4)
else() elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Intel|Clang)")
target_compile_options(${target_name} PRIVATE -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated) target_compile_options(${target_name} PRIVATE -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated)
endif() endif()
if(PYBIND11_WERROR) if(PYBIND11_WERROR)
if(MSVC) if(MSVC)
target_compile_options(${target_name} PRIVATE /WX) target_compile_options(${target_name} PRIVATE /WX)
else() elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Intel|Clang)")
target_compile_options(${target_name} PRIVATE -Werror) target_compile_options(${target_name} PRIVATE -Werror)
endif() endif()
endif() endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment