Re: [PATCH spice-common 3/3] meson: Cleanup optional dependency checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> > 
> > We can follow the same practice as in headers and function checks above,
> > by using the dependency name itself to set the configuration data.
> > 
> > Also, if a combo is used, the first value is used as default if none is
> > specified. Thus, we can remove the default value for opus from
> > meson_options.txt.
> > ---
> >  meson.build       | 9 +++------
> >  meson_options.txt | 1 -
> >  2 files changed, 3 insertions(+), 7 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index dd5127a..e6ab203 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -113,12 +113,9 @@ endforeach
> >  #
> >  # Non-mandatory/optional dependencies
> >  #
> > -# Check deps which are optional but enabled by default. This foreach block
> > only
> > -# checks the option, and adds the package to the deps list, while the real
> > check
> > -# for the dependency is done in the foreach block below.
> >  optional_deps = [
> > -                    ['celt051', '>= 0.5.1.1', 'HAVE_CELT051'],
> > -                    ['opus', '>= 0.9.14', 'HAVE_OPUS'],
> > +                    ['celt051', '>= 0.5.1.1'],
> > +                    ['opus', '>= 0.9.14'],
> >                  ]
> >  foreach dep : optional_deps
> >    option_value = get_option(dep[0])
> > @@ -126,7 +123,7 @@ foreach dep : optional_deps
> >      d = dependency(dep[0], required: (option_value == 'true'), version :
> >      dep[1])
> >      if d.found()
> >        spice_common_deps += d
> > -      spice_common_config_data.set(dep[2], '1')
> > +      spice_common_config_data.set('HAVE_@0@'.format(dep[0].to_upper()),
> > '1')
> 
> Is there something better than to_upper? Some function that handle
> characters like dash which cannot be used for identifiers?
> 

There is underscorify, maybe combining underscorify and to_upper?

> >      endif
> >    endif
> >  endforeach
> > diff --git a/meson_options.txt b/meson_options.txt
> > index 6994d91..3d04b4d 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -19,7 +19,6 @@ option('celt051',
> >  option('opus',
> >      type : 'combo',
> >      choices : ['true', 'false', 'auto'],
> > -    value : 'true',
> >      description: 'Enable Opus audio codec (default=true)')
> >  
> 
> OT: There is a pending patch removing the "(default=true)" part from
> description. What do you think about it?
> 
> >  option('python-checks',
> 
> Otherwise:
> Acked-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> 

Still ack

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]