]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
cmake: add configure option 'ENABLE_WERROR' to keep in sync with autotools
authorRalf Habacker <ralf.habacker@freenet.de>
Wed, 1 Dec 2021 15:03:22 +0000 (16:03 +0100)
committerSimon McVittie <smcv@collabora.com>
Fri, 10 Dec 2021 13:36:28 +0000 (13:36 +0000)
CMakeLists.txt
README.cmake

index 9ba1a39715198bb037ae8e4bfb074cb18d87cf1d..3b57e4e01d91b97699e08d1f802e5ac8338a68dd 100644 (file)
@@ -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(
index 7c984430f9446f38a2246944b13d400e70e8251d..1d32302a78ac424686cb7849a13e7f2d4d2bd332 100644 (file)
@@ -139,6 +139,9 @@ DBUS_ENABLE_ANSI:BOOL=OFF
 // build DOXYGEN documentation (requires Doxygen)
 DBUS_ENABLE_DOXYGEN_DOCS:BOOL=OFF
 
+// Unconditionally make all compiler warnings fatal
+ENABLE_WERROR:BOOL=OFF
+
 // build qt help documentation (requires qhelpgenerator(-qt5));
 // set INSTALL_QCH_DIR for custom qch installation path
 ENABLE_QT_HELP:STRING=AUTO