aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-12-17 14:19:56 +0100
committerRobert Tari <robert@tari.in>2021-12-17 14:32:09 +0100
commitf34268959a993ca6e1070a8ca36c319fc205d05a (patch)
tree4cd43a667cc14afb3aa74463185a0c3e9071daff /CMakeLists.txt
parenteeb9ddc6a66cd84d89141866d629800f729d9883 (diff)
downloadayatana-indicator-power-f34268959a993ca6e1070a8ca36c319fc205d05a.tar.gz
ayatana-indicator-power-f34268959a993ca6e1070a8ca36c319fc205d05a.tar.bz2
ayatana-indicator-power-f34268959a993ca6e1070a8ca36c319fc205d05a.zip
Clean up compilation flags
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt26
1 files changed, 9 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1de415a..2bdab9d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,10 +23,17 @@ else()
endif()
if(ENABLE_WERROR)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+ add_definitions("-Werror")
endif()
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_definitions("-Weverything")
+else()
+ add_definitions("-Wall")
+endif()
+
+add_definitions("-Wno-sign-compare") # Needed for GTest on Ubuntu
+
##
## GNU standard installation directories
##
@@ -87,20 +94,6 @@ add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/tests)
-##
-## Actual building
-##
-
-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- set(C_WARNING_ARGS "${C_WARNING_ARGS} -Weverything")
- set(C_WARNING_ARGS "${C_WARNING_ARGS} -Wno-c++98-compat -Wno-padded") # these are annoying
- set(C_WARNING_ARGS "${C_WARNING_ARGS} -Wno-documentation") # gtk-doc != doxygen
-else()
- set(C_WARNING_ARGS "${C_WARNING_ARGS} -Wall -Wformat=2") # Use -Wextra and -Wpedantic explicitly if needed
-endif()
-set(C_WARNING_ARGS "${C_WARNING_ARGS} -Wno-missing-field-initializers") # GActionEntry
-
-
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories (${CMAKE_CURRENT_BINARY_DIR}/include)
@@ -109,7 +102,6 @@ add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(po)
-
# testing & coverage
if (ENABLE_TESTS)
enable_testing ()