aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-08-09 21:42:06 +0200
committerRobert Tari <robert@tari.in>2021-08-30 01:37:23 +0200
commitbb20e9cd21132e11f53b9c259f16b494de3bf5f3 (patch)
tree7908b00958782dde07fde206ae147ffaf44bf8f5
parent41779f67416ac404634c2574638e51de63fd2c50 (diff)
downloadayatana-indicator-datetime-bb20e9cd21132e11f53b9c259f16b494de3bf5f3.tar.gz
ayatana-indicator-datetime-bb20e9cd21132e11f53b9c259f16b494de3bf5f3.tar.bz2
ayatana-indicator-datetime-bb20e9cd21132e11f53b9c259f16b494de3bf5f3.zip
Add ENABLE_WERROR option
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a6c404..ef09a60 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,8 +9,11 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (PROJECT_VERSION "0.8.3")
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)
@@ -19,6 +22,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
##
@@ -143,3 +151,4 @@ endif()
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Unit tests: ${ENABLE_TESTS}")
+message(STATUS "Build with -Werror: ${ENABLE_WERROR}")