From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 16D37A0553; Mon, 17 Feb 2020 11:48:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F6BC1DA0C; Mon, 17 Feb 2020 11:48:50 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id CE7161DA02 for ; Mon, 17 Feb 2020 11:48:48 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2020 02:48:47 -0800 X-IronPort-AV: E=Sophos;i="5.70,452,1574150400"; d="scan'208";a="228383896" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.79]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Feb 2020 02:48:46 -0800 Date: Mon, 17 Feb 2020 10:48:43 +0000 From: Bruce Richardson To: agupta3@marvell.com Cc: Harman Kalra , dev@dpdk.org Message-ID: <20200217104843.GB861@bricha3-MOBL.ger.corp.intel.com> References: <1581925669-15294-1-git-send-email-agupta3@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1581925669-15294-1-git-send-email-agupta3@marvell.com> User-Agent: Mutt/1.12.1 (2019-06-15) Subject: Re: [dpdk-dev] [PATCH] net/octeontx: meson build fix if octeontx drivers are disabled X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Feb 17, 2020 at 01:17:49PM +0530, agupta3@marvell.com wrote: > From: Amit Gupta > > Add a condition to check if octeontx drivers are disabled. > octeontx drivers are built only if dependent drivers i.e. > ethdev, mempool and common/octeontx are enabled. > > BugZilla ID # BUG 387 > > Signed-off-by: Amit Gupta > --- > drivers/net/octeontx/base/meson.build | 32 ++++++++++++++++++++++++-------- > 1 file changed, 24 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/octeontx/base/meson.build b/drivers/net/octeontx/base/meson.build > index a06a2c8..50e7972 100644 > --- a/drivers/net/octeontx/base/meson.build > +++ b/drivers/net/octeontx/base/meson.build > @@ -9,17 +9,33 @@ sources = [ > > depends = ['ethdev', 'mempool_octeontx'] > static_objs = [] > -foreach d: depends > - static_objs += [get_variable('static_rte_' + d)] > + > +disabled_drivers = get_option('disable_drivers').split(',') > + > +build = true > +foreach disable_path: disabled_drivers > + if (('net/octeontx' == disable_path) or > + ('event/octeontx' == disable_path) or > + ('common/octeontx' == disable_path) or > + ('mempool/octeontx' == disable_path)) > + build = false > + endif > endforeach > > c_args = cflags > if allow_experimental_apis > - c_args += '-DALLOW_EXPERIMENTAL_API' > + c_args += '-DALLOW_EXPERIMENTAL_API' > endif > -base_lib = static_library('octeontx_base', sources, > - c_args: c_args, > - dependencies: static_objs, > -) > > -base_objs = base_lib.extract_all_objects() > +if build > + foreach d: depends > + static_objs += [get_variable('static_rte_' + d)] > + endforeach > + > + base_lib = static_library('octeontx_base', sources, > + c_args: c_args, > + dependencies: static_objs, > + ) > + > + base_objs = base_lib.extract_all_objects() > +endif A better fix here might be possible using the fact that the get_variable() call allows passing a fallback value in the case of failure. Therefore something like the below might work cleaner: foreach d: depends static_obj = [get_variable('static_rte_' + d, ''] if static_obj == '' build = false reason = '....' subdir_done() endif static_objs += static_obj ... Maybe a disabler object could be used also. Regards, /Bruce