From: TimePath Date: Sun, 6 Aug 2017 07:59:55 +0000 (+1000) Subject: Add error flags (no changes yet) X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9273c45f6899a22998839064d4f04f1ea66d5af9;p=xonotic%2Fnetradiant.git Add error flags (no changes yet) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 397737a9..bbad9b9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,15 +63,49 @@ endif () #----------------------------------------------------------------------- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti") -macro(addflags args) +macro(addflags_c args) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${args}") +endmacro() +macro(addflags_cxx args) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${args}") endmacro() +macro(addflags args) + addflags_c("${args}") + addflags_cxx("${args}") +endmacro() addflags("-fno-strict-aliasing") if (NOT WIN32) addflags("-fvisibility=hidden") endif () +if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + addflags("-Werror") + addflags("-pedantic-errors") +endif () + +addflags("-Wall") +addflags("-Wextra") +addflags("-pedantic") + +addflags("-Wno-extra") +addflags("-Wno-switch") +addflags("-Wno-pedantic") +addflags("-Wno-parentheses") +addflags("-Wno-write-strings") +addflags("-Wno-unused-function") +addflags("-Wno-unused-variable") +addflags("-Wno-unused-parameter") +addflags("-Wno-deprecated-declarations") +addflags("-Wno-unused-but-set-variable") +addflags("-Wno-missing-field-initializers") + +addflags_c("-Wno-int-conversion") +addflags_c("-Wno-pointer-to-int-cast") +addflags_c("-Wno-incompatible-pointer-types") + +addflags_cxx("-Wno-reorder") +addflags_cxx("-Wno-delete-non-virtual-dtor") + set(CMAKE_POSITION_INDEPENDENT_CODE 1) set(GTK_TARGET 2 CACHE STRING "GTK target") add_definitions(-DGTK_TARGET=${GTK_TARGET})