aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-10 22:05:07 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-10 22:05:07 +0200
commit5f9091777d9bfc6cbe5b09eaa584514d20417e4b (patch)
tree30de5dbeb7f42a96937cd698293667ff404cac9c
parent11a61d41e4018639a1f775b929ffaa09abf403f0 (diff)
parent7a57a70b3eb96b9f75c35b7263681df19af86586 (diff)
downloadayatana-indicator-keyboard-5f9091777d9bfc6cbe5b09eaa584514d20417e4b.tar.gz
ayatana-indicator-keyboard-5f9091777d9bfc6cbe5b09eaa584514d20417e4b.tar.bz2
ayatana-indicator-keyboard-5f9091777d9bfc6cbe5b09eaa584514d20417e4b.zip
Merge branch 'tari01-pr/add-enable-werror-option'
Attributes GH PR #15: https://github.com/AyatanaIndicators/ayatana-indicator-keyboard/pull/15
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 191e3921..45149409 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,7 @@ set(PACKAGE ${CMAKE_PROJECT_NAME})
# Options
option(ENABLE_TESTS "Enable all tests and checks" OFF)
option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF)
+option(ENABLE_WERROR "Treat all build warnings as errors" OFF)
if(ENABLE_COVERAGE)
set(ENABLE_TESTS ON)
@@ -20,6 +21,11 @@ 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()
+
# GNU standard installation directories
include (GNUInstallDirs)
set (CMAKE_INSTALL_PKGLIBEXECDIR "${CMAKE_INSTALL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")
@@ -78,3 +84,4 @@ endif()
# Display config info
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Unit tests: ${ENABLE_TESTS}")
+message(STATUS "Build with -Werror: ${ENABLE_WERROR}")