diff --git a/CMakeLists.txt b/CMakeLists.txt index 24de6843b..4ed0249b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,7 +163,7 @@ if (MSVC) endif () # AppleClang-specific compiler flags, we set for all targets since we want these flags also for tests and examples -if (CMAKE_CXX_STANDARD EQUAL 11 AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") +if (CMAKE_CXX_FLAGS MATCHES "-Werror" AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-enum-constexpr-conversion -Wno-deprecated-declarations -Wno-deprecated-builtins -Wno-unused-but-set-variable") endif ()