summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2022-04-07 13:53:42 +0200
committerSimon McVittie <smcv@collabora.com>2022-04-21 13:51:55 +0000
commitbbd3f90a8da990ff9a38761a0b5c2f467abdd84e (patch)
treea5fff6735cf2d7d409122ff4031917a617c9efe2 /cmake
parent4b73505869d9dbafd255c182abe867290c4f72e6 (diff)
downloaddbus-bbd3f90a8da990ff9a38761a0b5c2f467abdd84e.tar.gz
cmake: Fix not detecting unsupported g++ related warning checks
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>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/Macros.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmake/modules/Macros.cmake b/cmake/modules/Macros.cmake
index 8d021d37..04ee287d 100644
--- a/cmake/modules/Macros.cmake
+++ b/cmake/modules/Macros.cmake
@@ -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)