CMake: Add option to enable -Werror cflag in some areas
[blender.git] / intern / cycles / CMakeLists.txt
index acd6cd69329d55d77a13256346ffb397e4e844d7..c252a613cef74f3eedeb5a76c625ebabcf0149a1 100644 (file)
@@ -14,6 +14,11 @@ include(cmake/external_libs.cmake)
 # todo: refactor this code to match scons
 # note: CXX_HAS_SSE is needed in case passing SSE flags fails altogether (gcc-arm)
 
+if(WITH_CYCLES_WERROR)
+       ADD_CHECK_C_COMPILER_FLAG(CMAKE_C_FLAGS C_WERROR -Werror)
+       ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS C_WERROR -Werror)
+endif()
+
 if(NOT WITH_CPU_SSE)
        set(CXX_HAS_SSE FALSE)
        set(CXX_HAS_AVX FALSE)