[libvirt PATCH 6/6] meson: don't probe for -Werror if -Dwerror is enabled

Pavel Hrdina phrdina at redhat.com
Thu Apr 8 11:38:10 UTC 2021


On Thu, Apr 08, 2021 at 11:58:23AM +0100, Daniel P. Berrangé wrote:
> Meson has its own mechanism to turn on -Werror with the -Dwerror option.
> If this is set, then there is no reason for libvirt to check for -Werror
> itself.

s/-Dwerror/--werror/ here and in $SUBJECT

In meson --werror is build-in option so it is not used together with the
-D{name} option.

> We remove the summary line output because it is potentially misleading
> when libvirt hasn't enabled -Werror, but meson has.
> 
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
>  meson.build | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 9fda0c7948..725d0e1cf0 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -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
>  
> @@ -2300,7 +2300,6 @@ else
>    loader_res = ''
>  endif
>  misc_summary = {
> -  'Use -Werror': cc_flags.contains('-Werror'),
>    'Warning Flags': supported_cc_flags,
>    'docs': gen_docs,
>    'tests': build_tests,
> -- 
> 2.30.2
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210408/c1c1a241/attachment-0001.sig>


More information about the libvir-list mailing list