meson: don't probe for -Werror if --werror is enabled

Meson has its own mechanism to turn on -Werror with the --werror option.
If this is set, then there is no reason for libvirt to check for -Werror
itself.

We remove the summary line output because it is potentially misleading
when libvirt hasn't enabled -Werror, but meson has.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2021-04-08 11:50:30 +01:00
parent a9461d456c
commit 3c3c55be66

View File

@ -207,7 +207,7 @@ cc = meson.get_compiler('c')
cc_flags = []
git_werror = get_option('git_werror')
if git_werror.enabled() or git_werror.auto() and git
if (git_werror.enabled() or git_werror.auto()) and git and not get_option('werror')
cc_flags += [ '-Werror' ]
endif
@ -2269,7 +2269,6 @@ else
loader_res = ''
endif
misc_summary = {
'Use -Werror': cc_flags.contains('-Werror'),
'Warning Flags': supported_cc_flags,
'docs': gen_docs,
'tests': build_tests,