aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-08-09 21:37:26 +0200
committerRobert Tari <robert@tari.in>2021-08-09 21:37:26 +0200
commit13f51c1daf80e0c955910d2a7233f3124360c647 (patch)
tree6593fd8f84ccc6abd19875510927dc9645ef6596
parent0d59a1e9f2b05021fd2b0e7e1ef0a849de92a547 (diff)
downloadayatana-indicator-session-13f51c1daf80e0c955910d2a7233f3124360c647.tar.gz
ayatana-indicator-session-13f51c1daf80e0c955910d2a7233f3124360c647.tar.bz2
ayatana-indicator-session-13f51c1daf80e0c955910d2a7233f3124360c647.zip
Add ENABLE_WERROR option
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f067b8a..0cb1d41 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,8 +11,10 @@ set (PROJECT_VERSION "0.8.2")
set (PACKAGE ${CMAKE_PROJECT_NAME})
set (GETTEXT_PACKAGE "ayatana-indicator-session")
+# 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)
@@ -21,6 +23,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
##
@@ -87,3 +94,4 @@ endif()
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Unit tests: ${ENABLE_TESTS}")
+message(STATUS "Build with -Werror: ${ENABLE_WERROR}")