Use -Werror to fail the build on compiler warnings

Use make -k so that all warnings are ouput if there are any.
This is the future :-)
master
Nicholas Brown 2017-12-15 15:31:26 +00:00
parent 9607750c06
commit 6f4df87bc9
2 changed files with 3 additions and 4 deletions

View File

@ -145,4 +145,4 @@ matrix:
before_install:
- eval "${MATRIX_EVAL}"
script: cmake -DCMAKE_INSTALL_PREFIX=/tmp -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSUPPORT_JOURNALD=ON -DSUPPORT_DTLS="$DTLS" -DSUPPORT_ZMQ="$ZMQ" . && make && make test && make install
script: cmake -DCMAKE_INSTALL_PREFIX=/tmp -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSUPPORT_JOURNALD=ON -DSUPPORT_DTLS="$DTLS" -DSUPPORT_ZMQ="$ZMQ" . && make -k && make test && make install

View File

@ -26,13 +26,12 @@ PROJECT(VERMONT)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
# TODO: Once all warnings are fixed add -Werror to both of these
# TODO: Bonus: Remove -Wno-unused-parameter and fix all code as this one gernerates hundreds of warnings
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -Wall -pedantic -Wextra -Wno-unused-parameter"
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -Werror -Wall -pedantic -Wextra -Wno-unused-parameter"
CACHE STRING
"Recommended C Flags"
FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -pedantic -Wextra -Wno-unused-parameter"
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Werror -Wall -pedantic -Wextra -Wno-unused-parameter"
CACHE STRING
"Recommended C++ Flags"
FORCE)