> From: Thomas Monjalon [mailto:tho...@monjalon.net]
> Sent: Thursday, 6 January 2022 10.49
> 
> 06/01/2022 09:23, Morten Brørup:
> > > From: Bruce Richardson [mailto:bruce.richard...@intel.com]
> > > Sent: Wednesday, 25 September 2019 16.56
> > >
> > > Add support for a new build option to turn off certain drivers. Any
> > > other
> > > drivers which depend on the one being disabled will also be
> disabled
> > > with a
> > > suitable debug message.
> > >
> > > Signed-off-by: Bruce Richardson <bruce.richard...@intel.com>
> >
> > Hi Bruce,
> >
> > I was trying something along the lines of:
> >
> > meson configure -Ddisable_drivers=net/* -Denable_drivers=net/i40e
> >
> > But it seems that enable_drivers does not override disable_drivers.
> Ninja says:
> 
> It is the opposite logic. "disable" overrides "enable":
> 
>         if not enable_drivers.contains(drv_path)
>             build = false
>             reason = 'not in enabled drivers build config'
>         elif disable_drivers.contains(drv_path)
>             if always_enable.contains(drv_path)
>                 message('Driver @0@ cannot be disabled, not
> disabling.'.format(drv_path))
>             else
>                 build = false
>                 reason = 'explicitly disabled via build config'
>             endif
>         endif
> 
> In this case, you don't need to disable everything because of this:
> 
> if enable_drivers.length() == 0
>     enable_drivers = run_command(list_dir_globs, '*/*', check:
> true).stdout().split()
> endif
> 

Thank you, @Thomas! That solved the drivers part of my question.

@Bruce:

If you have too much time on your hands, and want to experiment with set theory 
on Meson, you could implement a "longest prefix match" for this, making the 
narrower selection take precedence. Just kidding! Enabling/disabling drivers as 
Thomas described works great.

Still, a similar Meson option for selecting libraries would be nice.

Reply via email to