CMake: Add option to enable -Werror cflag in some areas
[blender.git] / source / blender / compositor / CMakeLists.txt
index 0d35d060f5f7db1edda51045b8ac46cf5176c2bc..7a8c5596a578c509f5944dc5b660b9f47c765fee 100644 (file)
@@ -540,6 +540,12 @@ set(SRC
 list(APPEND INC
        ${CMAKE_CURRENT_BINARY_DIR}/operations
 )
+
+if(WITH_COMPOSITOR_WERROR)
+       ADD_CHECK_C_COMPILER_FLAG(CMAKE_C_FLAGS C_WERROR -Werror)
+       ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS C_WERROR -Werror)
+endif()
+
 data_to_c(${CMAKE_CURRENT_SOURCE_DIR}/operations/COM_OpenCLKernels.cl
           ${CMAKE_CURRENT_BINARY_DIR}/operations/COM_OpenCLKernels.cl.h SRC)