diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-08-10 22:00:18 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-08-10 22:00:18 +0200 |
commit | 82ddfccb4717c568d943d3ed26965b256beefafe (patch) | |
tree | 55c3cf4982344deaac7671b2348acd720e19babb | |
parent | b83b458481367abf82cf227ee5320803d9b84c9e (diff) | |
parent | f4c60ba549ecfefbf4ad07a7a52c6875d7d8ca6c (diff) | |
download | ayatana-indicator-application-82ddfccb4717c568d943d3ed26965b256beefafe.tar.gz ayatana-indicator-application-82ddfccb4717c568d943d3ed26965b256beefafe.tar.bz2 ayatana-indicator-application-82ddfccb4717c568d943d3ed26965b256beefafe.zip |
Merge branch 'tari01-pr/add-enable-werror-option'
Attributes GH PR #16: https://github.com/AyatanaIndicators/ayatana-indicator-application/pull/16
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index dfc1576..bc1aabd 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 set(CMAKE_BUILD_TYPE "Release") @@ -53,3 +61,4 @@ endif() message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}") message(STATUS "Unit tests: ${ENABLE_TESTS}") +message(STATUS "Build with -Werror: ${ENABLE_WERROR}") |