summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2021-12-01 16:03:22 +0100
committerSimon McVittie <smcv@collabora.com>2021-12-10 13:36:28 +0000
commit8e2f0f588e21ff835f87688c4df543ec6545f33d (patch)
treee30a718ddc808c1874c735df624790a9804db4b0 /CMakeLists.txt
parent667b153dce764a6dbaa2ac414fa8b9170de29098 (diff)
downloaddbus-8e2f0f588e21ff835f87688c4df543ec6545f33d.tar.gz
cmake: add configure option 'ENABLE_WERROR' to keep in sync with autotools
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ba1a397..3b57e4e0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -233,6 +233,8 @@ endif()
string(APPEND CMAKE_C_FLAGS " -fno-common")
string(APPEND CMAKE_CXX_FLAGS " -fno-common")
+option(ENABLE_WERROR "Unconditionally make all compiler warnings fatal" OFF)
+
if(MSVC)
# Use the highest warning level
if(WALL)
@@ -331,6 +333,9 @@ else()
)
set(WARNINGS_ERRORS
)
+ if(ENABLE_WERROR)
+ list(APPEND WARNINGS error)
+ endif()
endif()
generate_compiler_warning_flags(