diff --git a/CMakeLists.txt b/CMakeLists.txt index ccc056f01..dc872d29c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,10 +24,15 @@ if(NOT MSVC) -fno-rtti -Wsign-compare -Wunused-variable - -Werror #--analyze #-Os # GCC size optimization flag ) + + if (CMAKE_BUILD_TYPE STREQUAL "Release") + add_definitions( + -Werror + ) + endif() endif(NOT MSVC) enable_testing()