From: Benjamin Otte Date: Wed, 10 Nov 2021 19:01:36 +0000 (+0100) Subject: build: Don't use any -Werror in release builds X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~5^2~151^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=362e91c40b5036ec0ac0a5a0c231a4b58414509f;p=gtk4.git build: Don't use any -Werror in release builds Do kep them for debug and debugoptimized builds though. Keeping -Werror flags in release builds causes issues with forward compatibility, when new compiler releases or different toolchains suddenly cause those warnings to be emitted during compilation. While we certainly want those issues to be investigated and fixed, they should not prevent anyone from building GTK until they are. Resolves #4388 --- diff --git a/meson.build b/meson.build index 5eb86dce0e..66c398f7fe 100644 --- a/meson.build +++ b/meson.build @@ -291,6 +291,9 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang' '-Wundef', '-Wuninitialized', '-Wunused', + ] + + extra_warnings = [ '-Werror=address', '-Werror=array-bounds', '-Werror=empty-body', @@ -312,6 +315,16 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang' '-Werror=write-strings', ] + if get_option('buildtype').startswith('debug') + foreach warning: extra_warnings + test_cflags += '-Werror=@0@'.format(warning) + endforeach + else + foreach warning: extra_warnings + test_cflags += '-W@0@'.format(warning) + endforeach + endif + if cc.get_id() == 'gcc' test_cflags += ['-Wcast-align'] # This warns too much on clang endif