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 7BF994374C; Wed, 20 Dec 2023 16:08:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07EA140291; Wed, 20 Dec 2023 16:08:13 +0100 (CET) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 4B1E04021F for ; Wed, 20 Dec 2023 16:08:11 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 0324B2111A; Wed, 20 Dec 2023 16:08:11 +0100 (CET) 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 v3 3/3] build: RFC - add support for optional dependencies X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Wed, 20 Dec 2023 16:08:08 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F0E8@smartserver.smartshare.dk> In-Reply-To: <20231220142152.492556-4-bruce.richardson@intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v3 3/3] build: RFC - add support for optional dependencies Thread-Index: AdozT+8O2ePj132AQdKJbKZ/mPwHxwAAuwGw References: <20231103162830.593702-1-bruce.richardson@intel.com> <20231220142152.492556-1-bruce.richardson@intel.com> <20231220142152.492556-4-bruce.richardson@intel.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Bruce Richardson" , 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: Bruce Richardson [mailto:bruce.richardson@intel.com] > Sent: Wednesday, 20 December 2023 15.22 >=20 > In order to remove more libraries from the mandatory list, we need to > have support for optionally having a dependency from a driver or > library > to another driver or lib. This patch adds this support by adding a new > optional_deps variable, the contents of which are added to the deps > list > if those optional dependencies are present in the build. >=20 > Signed-off-by: Bruce Richardson > --- > drivers/meson.build | 7 +++++++ > lib/meson.build | 7 +++++++ > 2 files changed, 14 insertions(+) >=20 > diff --git a/drivers/meson.build b/drivers/meson.build > index 5ba534049a..af2d8da5a8 100644 > --- a/drivers/meson.build > +++ b/drivers/meson.build > @@ -127,6 +127,7 @@ foreach subpath:subdirs > includes =3D [include_directories(drv_path)] > # set up internal deps. Drivers can append/override as > necessary > deps =3D std_deps > + optional_deps =3D [] (I'm a meson noob, so please bear with my stupid questions.) Is a separate "optional_deps" necessary? If a driver has any of these = dependencies, why can it not just add them to the "deps" in the driver's = meson.build file? Ohhh... It's the other way around: The driver only depends on the other = (optional) lib if that other lib is enabled! Correct? Either way, please add an in-line comment describing optional_deps in = the meson.build file. > # ext_deps: Stores external library dependency got > # using dependency() (preferred) or find_library(). > # For the find_library() case (but not with dependency()) we > also > @@ -168,6 +169,12 @@ foreach subpath:subdirs > # get dependency objs from strings > shared_deps =3D ext_deps > static_deps =3D ext_deps > + foreach d:optional_deps > + #if optional dep exists, add it to the deps list > + if is_variable('shared_rte_' + d) > + deps +=3D d > + endif > + endforeach > foreach d:deps > if not build > break The same feedback also applies to the lib/meson.build changes.