Skip to content

Commit

Permalink
Added EVENT__ENABLE_GCC_WARNINGS, turns all warnings into errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoakimSoderberg committed Dec 19, 2013
1 parent f780593 commit dd413bd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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
Expand Down

0 comments on commit dd413bd

Please sign in to comment.