From 9103d232a5cf669e4d230b6216532279b39aa0f6 Mon Sep 17 00:00:00 2001 From: patrick96 Date: Tue, 9 Apr 2019 00:19:27 +0200 Subject: [PATCH] build: Remove -Werror Whenever a new gcc version is released that introduces new warnings, this breaks lots of builds on the user's side. This change pushes the detection of these new warnings a bit back until either a user reports warnings or developers get the new compiler updates. I think this is a good tradeoff since release builds are no longer totally broken as soon as a new compiler version comes out. Travis still uses -Werror because there we actually want builds to fail. --- cmake/01-core.cmake | 10 +--------- common/travis/configure.sh | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/cmake/01-core.cmake b/cmake/01-core.cmake index 2bc6e91a..50993ab7 100644 --- a/cmake/01-core.cmake +++ b/cmake/01-core.cmake @@ -21,14 +21,7 @@ string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER) # Compiler flags set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") -if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") - # there's no way to modify the code to avoid this warning, so we must - # suppress it if we use -Werror - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-noexcept-type") -endif() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic") if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # Need dprintf() for FreeBSD 11.1 and older @@ -44,7 +37,6 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-zero-length-array") endif() -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wno-error") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g2") diff --git a/common/travis/configure.sh b/common/travis/configure.sh index bd3d22b1..b67d78bd 100755 --- a/common/travis/configure.sh +++ b/common/travis/configure.sh @@ -25,7 +25,7 @@ fi cmake \ -DCMAKE_CXX_COMPILER="${CXX}" \ - -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ + -DCMAKE_CXX_FLAGS="${CXXFLAGS} -Werror" \ -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \ -DBUILD_TESTS:BOOL="${BUILD_TESTS:-OFF}" \ -DBUILD_DOC:BOOL="${BUILD_DOC:-OFF}" \