diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-08-10 22:03:35 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-08-10 22:03:35 +0200 |
commit | cb7413021be32a26174149d3e1c16cc6c561a16b (patch) | |
tree | 2c400324315d473e1d13e30e8739917850ea86ea | |
parent | 304b8b83854659d5d69af690bf8525a2bc0fd622 (diff) | |
parent | cb0c07eb135d889d4015a0895d1c3dd053c8f1a5 (diff) | |
download | libayatana-indicator-cb7413021be32a26174149d3e1c16cc6c561a16b.tar.gz libayatana-indicator-cb7413021be32a26174149d3e1c16cc6c561a16b.tar.bz2 libayatana-indicator-cb7413021be32a26174149d3e1c16cc6c561a16b.zip |
Merge branch 'tari01-pr/add-enable-werror-option'
Attributes GH PR #52: https://github.com/AyatanaIndicators/libayatana-indicator/pull/52
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 593fc94..8b92a3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,11 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) SET(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE) endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +# 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) @@ -15,6 +18,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() + # Check for prerequisites option(FLAVOUR_GTK2 "Build against GTK+-2.0" OFF) @@ -132,3 +140,4 @@ message(STATUS "GTK+-2.0 build: ${FLAVOUR_GTK2}") message(STATUS "Loader enabled ${ENABLE_LOADER}") message(STATUS "IDO enabled: ${ENABLE_IDO}") message(STATUS "Unit tests: ${ENABLE_TESTS}") +message(STATUS "Build with -Werror: ${ENABLE_WERROR}") |