From: Joakim Soderberg Date: Thu, 19 Dec 2013 12:03:49 +0000 (+0000) Subject: Added EVENT__ENABLE_GCC_WARNINGS, turns all warnings into errors. X-Git-Tag: release-2.1.4-alpha~42^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd413bd19b918c9e586b4a2747a361b79a13e88f;p=libevent Added EVENT__ENABLE_GCC_WARNINGS, turns all warnings into errors. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cf39093..70b33f2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,7 @@ if (EVENT__COVERAGE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") endif() +# GCC specific options. if (CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") @@ -94,6 +95,11 @@ if (CMAKE_COMPILER_IS_GNUCC) # TODO: Add --gc-sections support. We need some checks for NetBSD to ensure this works. endif() + option(EVENT__ENABLE_GCC_WARNINGS "Make all GCC warnings into errors" OFF) + if (EVENT__ENABLE_GCC_WARNINGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + endif() + # We need to test for at least gcc 2.95 here, because older versions don't # have -fno-strict-aliasing execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion