From 3cd699ab586a843a8d302e4754e590c8a094d755 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Sat, 26 Jan 2013 01:38:10 -0500 Subject: [PATCH] Add compiler flags to GCC or G++ to treat warnings as errors. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0736be7..01068a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,14 @@ IF(MSVC) SET(CMAKE_LIBRARY_PATH "${CMAKE_LIBRARY_PATH};${MSVC_LIB_DIR}") ENDIF(MSVC) +IF(CMAKE_COMPILER_IS_GNUCC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Werror") +ENDIF() + +IF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror") +ENDIF() + ADD_SUBDIRECTORY(BPTCEncoder) ADD_SUBDIRECTORY(IO) ADD_SUBDIRECTORY(Core)