]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
cmake: Fix not detecting unsupported g++ related warning checks
authorRalf Habacker <ralf.habacker@freenet.de>
Thu, 7 Apr 2022 11:53:42 +0000 (13:53 +0200)
committerSimon McVittie <smcv@collabora.com>
Thu, 21 Apr 2022 13:51:55 +0000 (13:51 +0000)
Unsupported warnings are detected by cmake through errors during
compilation, which causes g++ not to detect them, since they are
only output as warnings. Setting -Werror ensures this.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
cmake/modules/Macros.cmake

index 8d021d37245bacbfc22a13e77615787ad079838c..04ee287d3671afac3ec7ec0803539f4b444c8a9f 100644 (file)
@@ -124,6 +124,8 @@ include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 function(check_compiler_warning_flag _flag _result _cxx)
     string(MAKE_C_IDENTIFIER "${_flag}" _varname)
+    # required to get errors
+    list(APPEND _flag -Werror)
     if (_cxx)
         check_cxx_compiler_flag("${_flag}" HAVE_CXX_FLAG${_varname})
         set(${_result} ${HAVE_CXX_FLAG${_varname}} PARENT_SCOPE)