[igt-dev] [PATCH i-g-t] meson: Add option to not build the assembler

Petri Latvala petri.latvala at intel.com
Wed Sep 16 08:46:14 UTC 2020


On Wed, Sep 09, 2020 at 10:52:37PM +0300, Arkadiusz Hiler wrote:
> On Mon, Aug 24, 2020 at 11:35:05AM +0300, Petri Latvala wrote:
> > New option -Dassembler=disabled will omit assembler/ from the build.
> > 
> > Signed-off-by: Petri Latvala <petri.latvala at intel.com>
> > Cc: Kalyan Kondapally <kalyan.kondapally at intel.com>
> > Cc: Arkadiusz Hiler <arek at hiler.eu>
> > Cc: Lukasz Fiedorowicz <lukasz.fiedorowicz at intel.com>
> > ---
> >  meson.build       | 4 +++-
> >  meson_options.txt | 4 ++++
> >  2 files changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index f4ee14f1..e8c8aaab 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -82,6 +82,7 @@ endforeach
> >  build_chamelium = get_option('chamelium')
> >  build_docs = get_option('docs')
> >  build_tests = not get_option('tests').disabled()
> > +build_assembler = get_option('assembler')
> >  with_libdrm = get_option('libdrm_drivers')
> >  
> >  build_info = ['Build type: ' + get_option('buildtype')]
> > @@ -306,9 +307,10 @@ build_info += 'Build tests: @0@'.format(build_tests)
> >  subdir('benchmarks')
> >  subdir('tools')
> >  subdir('runner')
> > -if libdrm_intel.found()
> > +if libdrm_intel.found() and build_assembler.enabled()
> >  	subdir('assembler')
> >  endif
> > +build_info += 'Build shader assembler: @0@'.format(build_assembler.enabled())
> 
> Are you sure this is going to do what you think it's going to do?

Sure? Absolutely not!

> My understanding is that .enabled() on feature option object[0]
> evaluates to true only if you explicityly set the option to 'enabled'.
> 
> Features default to auto unless changed with 'auto_features',
> and we don't do that.
> 
>   $ meson build
>   ...
>   Message: Build shader assembler: false
> 
> vs
> 
>   $ meson -Dassembler=enabled build
>   Message: Build shader assembler: true
> 
> This means we won't build assembler unless -Dassember=enabled, which
> doesn't match with the commit message.

Well that explains why build_tests uses "not foo.disabled()"


-- 
Petri Latvala


More information about the igt-dev mailing list