From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C196DA034D; Thu, 6 Jan 2022 11:10:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8525041140; Thu, 6 Jan 2022 11:10:30 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 93E6A410F7 for ; Thu, 6 Jan 2022 11:10:29 +0100 (CET) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH 3/3] build: support disabling drivers with meson Date: Thu, 6 Jan 2022 11:10:27 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D86DE1@smartserver.smartshare.dk> In-Reply-To: <1807554.CQOukoFCf9@thomas> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 3/3] build: support disabling drivers with meson Thread-Index: AdgC4pe0bQMJEXLrTvmTodP7kefcrgAAPxkg References: <20190925145531.52705-1-bruce.richardson@intel.com> <20190925145531.52705-4-bruce.richardson@intel.com> <98CBD80474FA8B44BF855DF32C47DC35D86DDF@smartserver.smartshare.dk> <1807554.CQOukoFCf9@thomas> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Thomas Monjalon" , "Bruce Richardson" Cc: X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > From: Thomas Monjalon [mailto:thomas@monjalon.net] > Sent: Thursday, 6 January 2022 10.49 >=20 > 06/01/2022 09:23, Morten Br=F8rup: > > > From: Bruce Richardson [mailto:bruce.richardson@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 > > > > Hi Bruce, > > > > I was trying something along the lines of: > > > > meson configure -Ddisable_drivers=3Dnet/* = -Denable_drivers=3Dnet/i40e > > > > But it seems that enable_drivers does not override disable_drivers. > Ninja says: >=20 > It is the opposite logic. "disable" overrides "enable": >=20 > if not enable_drivers.contains(drv_path) > build =3D false > reason =3D '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 =3D false > reason =3D 'explicitly disabled via build config' > endif > endif >=20 > In this case, you don't need to disable everything because of this: >=20 > if enable_drivers.length() =3D=3D 0 > enable_drivers =3D run_command(list_dir_globs, '*/*', check: > true).stdout().split() > endif >=20 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.