aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-10 22:02:02 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-10 22:02:02 +0200
commite7d58e51b1a101f742b381a9d5e258d5fe1b237c (patch)
treebae950ff5964537c518b38216ab0520c0ddf1238
parentc173a0e1b4b77db77175b30ed293b0923e7ee938 (diff)
parent8d3a18b677bba9ea31c0475fb9ac2cf43a841a7e (diff)
downloadlibayatana-appindicator-e7d58e51b1a101f742b381a9d5e258d5fe1b237c.tar.gz
libayatana-appindicator-e7d58e51b1a101f742b381a9d5e258d5fe1b237c.tar.bz2
libayatana-appindicator-e7d58e51b1a101f742b381a9d5e258d5fe1b237c.zip
Merge branch 'tari01-pr/add-enable-werror-option'
Attributes GH PR #29: https://github.com/AyatanaIndicators/libayatana-appindicator/pull/29
-rw-r--r--CMakeLists.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c28eab1..6b439f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,12 +7,11 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+# Options
+
option(ENABLE_TESTS "Enable all tests and checks" OFF)
option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF)
-
-# Check for prerequisites
-
-set(DEPS glib-2.0>=2.58 ayatana-indicator3-0.4>=0.8.4 gtk+-3.0>=3.24 dbusmenu-gtk3-0.4)
+option(ENABLE_WERROR "Treat all build warnings as errors" OFF)
if(ENABLE_COVERAGE)
set(ENABLE_TESTS ON)
@@ -21,6 +20,15 @@ else()
set(CMAKE_BUILD_TYPE "Release")
endif()
+if(ENABLE_WERROR)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+endif()
+
+# Check for prerequisites
+
+set(DEPS glib-2.0>=2.58 ayatana-indicator3-0.4>=0.8.4 gtk+-3.0>=3.24 dbusmenu-gtk3-0.4)
+
if(ENABLE_TESTS)
set(DEPS ${DEPS} dbus-1>=1.12 dbus-glib-1>=0.82)
endif()
@@ -72,3 +80,4 @@ endif()
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Unit tests: ${ENABLE_TESTS}")
+message(STATUS "Build with -Werror: ${ENABLE_WERROR}")