diff --git a/CMakeLists.txt b/CMakeLists.txt index cdabc9660..a87d5b5df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -466,10 +466,10 @@ if("Ninja" STREQUAL ${CMAKE_GENERATOR}) endif() # Add -Werror to C/C++ flags for newer compilers -#if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) -# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") -#endif() +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") +endif() message(STATUS "CMAKE_C_FLAGS is ${CMAKE_C_FLAGS}") message(STATUS "CMAKE_CXX_FLAGS is ${CMAKE_CXX_FLAGS}")