[Mesa-dev] [PATCH] meson: do not search for needless deps

Dylan Baker dylan at pnwbakers.com
Thu Oct 26 17:16:11 UTC 2017


Quoting Gert Wollny (2017-10-26 02:49:56)
> 
> Am Mittwoch, den 25.10.2017, 10:24 +0200 schrieb Erik Faye-Lund:
> > If we don't want to use these deps, there's no good reason to search
> > for them in the first place. This should shave a bit of time for the
> > initial build.
> > ---
> > 
> > This would be a way of dealing with Gert's suggestion. Goes on top
> > of the previous patch.
> > 
> > Thoughts?
> > 
> >  meson.build | 20 ++++++++++++++------
> >  1 file changed, 14 insertions(+), 6 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index e842bb1652..201956c4c8 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -666,9 +666,13 @@ if with_glvnd
> >  endif
> >  
> >  # TODO: make this conditional
> > -dep_valgrind = dependency('valgrind', required : false)
> > -if dep_valgrind.found() and with_valgrind
> > -  pre_args += '-DHAVE_VALGRIND'
> > +if with_valgrind
> > +  dep_valgrind = dependency('valgrind', required : false)
> > +  if dep_valgrind.found()
> > +    pre_args += '-DHAVE_VALGRIND'
> > +  endif
> > +else
> > +  dep_valgrind = []
> >  endif
> >  
> >  # pthread stubs. Lets not and say we didn't
> > @@ -681,9 +685,13 @@ dep_selinux = []
> >  
> >  # TODO: llvm-prefix and llvm-shared-libs
> >  
> > -dep_unwind = dependency('libunwind', required : false)
> > -if dep_unwind.found() and with_libunwind
> > -  pre_args += '-DHAVE_LIBUNWIND'
> > +if with_libunwind
> > +  dep_unwind = dependency('libunwind', required : false)
> > +  if dep_unwind.found()
> > +    pre_args += '-DHAVE_LIBUNWIND'
> > +  endif
> > +else
> > +  dep_unwind = []
> >  endif
> >  
> >  # TODO: flags for opengl, gles, dri
> 
> Obviously, I like this more, but after reviewing what is done with the
> autotools, I think it would be preferable if meson would do the same
> i.e. with autotools 
> 
>   --enable-libunwind=no -> don't use libunwind 
>   --enable-libunwind=yes -> require libunwind 
> 
> and if not given, then use it if available. The "force using libunwind"
> option is currently missing.
> 
> I don't know yet how to use meson properly, but I guess one could
> achieve this  by something like (put in the apropriate files): 
> 
> option('with_libunwind', 
>         type : 'combo', 
>         choices : ['auto', 'yes', 'no'])
> 
> if with_libunwind != 'no'
>   dep_unwind = dependency('libunwind', 
>                            required : with_libunwind == 'yes')
>   if dep_unwind.found()
>     pre_args += '-DHAVE_LIBUNWIND'
>   endif
> else
>   dep_unwind = []
> endif
> 
> Best, 
> Gert

That is in fact how you'd do it. The only thing I'd change is Ajax convinced me
that auto, yes, no should be auto, true, false. That way when you're passing
options you don't have to care whether it's a boolean or tri-state.

Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171026/7021bb9f/attachment.sig>


More information about the mesa-dev mailing list