# HG changeset patch # User Luke Mewburn # Date 1582004906 -39600 # Node ID deaa89f4a99459dfd33f787eab2e0984fb153f71 # Parent 3cbe458fbfa984b8b2a7c5ab0cb2e766fa409c4b add ERRORS_ON_WARNINGS to enable fatal compiler warnings diff -r 3cbe458fbfa9 -r deaa89f4a994 CMakeLists.txt --- a/CMakeLists.txt Tue Feb 18 16:23:53 2020 +1100 +++ b/CMakeLists.txt Tue Feb 18 16:48:26 2020 +1100 @@ -71,6 +71,11 @@ SET(DEBUG 1) ENDIF (CMAKE_BUILD_TYPE MATCHES "Debug|Profiling|DebugValgrind") +# Build with fatal warnings? +IF (ERRORS_ON_WARNINGS) + SET(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") +ENDIF (ERRORS_ON_WARNINGS) + # some subfolders use yacc and lex parsers SET(BISON_GENERATE_DEFINES TRUE) SET(BISON_PREFIX_OUTPUTS TRUE) @@ -109,4 +114,3 @@ IF ( BUILD_TESTING ) SUBDIRS(tests) ENDIF ( BUILD_TESTING ) - diff -r 3cbe458fbfa9 -r deaa89f4a994 include/freeDiameter/CMakeLists.txt --- a/include/freeDiameter/CMakeLists.txt Tue Feb 18 16:23:53 2020 +1100 +++ b/include/freeDiameter/CMakeLists.txt Tue Feb 18 16:48:26 2020 +1100 @@ -15,6 +15,9 @@ # Find TODO items in the code easily ? OPTION(ERRORS_ON_TODO "(development) Generate compilation errors on TODO items ?" OFF) +# Compiler warnings are fatal? +OPTION(ERRORS_ON_WARNINGS "(development) Compiler warnings cause compilation errors ?" OFF) + # In DEBUG mode, each log can contain pid, calling function and file for easy debug. Set to ON to display this information. OPTION(DEBUG_WITH_META "Show calling location in logs?" OFF)