From b6278e2421712b04892001f8cf866a09580f309e Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Fri, 14 Jan 2022 13:50:32 +0100 Subject: Clean up compilation flags --- CMakeLists.txt | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f6cbff..81525a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,16 @@ else() set(CMAKE_BUILD_TYPE "Release") endif() +if(ENABLE_WERROR) + add_definitions("-Werror") +endif() + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_definitions("-Weverything") +else() + add_definitions("-Wall") +endif() + # Check for prerequisites set(DEPS glib-2.0>=2.58 gtk+-3.0>=3.24) @@ -39,18 +49,6 @@ pkg_check_modules(PROJECT_DEPS REQUIRED ${DEPS}) include(GNUInstallDirs) set(PROJECT_VERSION "0.9.0") -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - - set(COMPILE_FLAGS "${COMPILE_FLAGS} -Weverything") - set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-c++98-compat -Wno-padded") - set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-documentation") - -else() - - set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wall") - -endif() - # Make everything add_subdirectory(src) -- cgit v1.2.3