On Thu, Jan 06, 2022 at 11:10:27AM +0100, Morten Brørup wrote:
> > 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.
>
Yes, I understand. I have a few concerns about implementing this just now
though. David previously posted a patch[1] to do what you are looking for, and
please see the discussion in that thread [2].

[1] http://inbox.dpdk.org/dev/20211110164814.5231-6-david.march...@redhat.com/
[2] http://inbox.dpdk.org/dev/yywcj0voyvuuy...@bricha3-mobl.ger.corp.intel.com/

Reply via email to