diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-08-10 21:49:53 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-08-10 21:49:53 +0200 |
commit | 0e8c18ce4a96cbf4bc85e92c3d323050d8903026 (patch) | |
tree | 4f3b8fce7719c5702d13bde76426f3ac1caab1f9 | |
parent | a3361b8fe0ce9d803fa0574ab8a46fd8cff01871 (diff) | |
parent | b0737af925f4872db0952e2fefe16d14b4f8cf4f (diff) | |
download | ayatana-indicator-power-0e8c18ce4a96cbf4bc85e92c3d323050d8903026.tar.gz ayatana-indicator-power-0e8c18ce4a96cbf4bc85e92c3d323050d8903026.tar.bz2 ayatana-indicator-power-0e8c18ce4a96cbf4bc85e92c3d323050d8903026.zip |
Merge branch 'tari01-pr/add-enable-werror-option'
Attributes GH PR #35: https://github.com/AyatanaIndicators/ayatana-indicator-power/pull/35
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 24f800e..9cc29fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,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) @@ -21,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 ## @@ -115,3 +121,4 @@ endif () message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}") message(STATUS "Unit tests: ${ENABLE_TESTS}") +message(STATUS "Build with -Werror: ${ENABLE_WERROR}") |