Build: Add CMake option to enable Werror

With -DENABLE_WERROR the -Werror flag will be passed to the compiler failing the build if a warning is emitted.
This commit is contained in:
Peter Keresztes Schmidt
2021-04-30 00:13:32 +02:00
parent 202c4ef28c
commit bf08502b9c
3 changed files with 13 additions and 0 deletions

View File

@@ -5,6 +5,12 @@ target_compile_options(zm-warning-interface
-Wimplicit-fallthrough
-Wno-unused-parameter)
if(ENABLE_WERROR)
target_compile_options(zm-warning-interface
INTERFACE
-Werror)
endif()
if(ASAN)
target_compile_options(zm-compile-option-interface
INTERFACE

View File

@@ -9,6 +9,12 @@ target_compile_options(zm-warning-interface
-Wno-unused-parameter
-Woverloaded-virtual)
if(ENABLE_WERROR)
target_compile_options(zm-warning-interface
INTERFACE
-Werror)
endif()
if(ASAN)
target_compile_options(zm-compile-option-interface
INTERFACE