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 317934374A; Wed, 20 Dec 2023 15:22:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC75842E6B; Wed, 20 Dec 2023 15:22:16 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 2E66242E6B for ; Wed, 20 Dec 2023 15:22:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703082135; x=1734618135; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ci4PhxlxAU3bj39lK6pqx7OyOmfp3aLWwzz9aH0MXNs=; b=O+GtHeW19H6wXqYtwql1fMcXlOJrAiO1PS3lBDyIKt31dMi8Hy2ZH5mM Fg2h/PbRDn/yITJq4HpyN58RJOu+V5TazDAxHd4+919IafNBY6yK5g7DX 9qZOaBDQ8qEpr8cT0ayYVD+CqAerl16hvN83fV8I13+5OZWS+5Mg1pkU6 Y9oV10ZS6WT5Bt+dDCGwSzEVMZiJR38H6snSpIlNbulpUw/FnLYA2SBPg 9V5F4aBdUGs23GxoSBCuEWdZdOXnkt8QmCGU56BJn0UeVqujNvEgnAP+1 iFk7JYdnCiEPo69rcsCeA18lWeLwev02ZosMGYRhttqT7LdtabayGYqPe Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="375974406" X-IronPort-AV: E=Sophos;i="6.04,291,1695711600"; d="scan'208";a="375974406" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2023 06:22:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="899730864" X-IronPort-AV: E=Sophos;i="6.04,291,1695711600"; d="scan'208";a="899730864" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.148]) by orsmga004.jf.intel.com with ESMTP; 20 Dec 2023 06:22:13 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: mb@smartsharesystems.com, Bruce Richardson Subject: [PATCH v3 3/3] build: RFC - add support for optional dependencies Date: Wed, 20 Dec 2023 14:21:52 +0000 Message-Id: <20231220142152.492556-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231220142152.492556-1-bruce.richardson@intel.com> References: <20231103162830.593702-1-bruce.richardson@intel.com> <20231220142152.492556-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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. Signed-off-by: Bruce Richardson --- drivers/meson.build | 7 +++++++ lib/meson.build | 7 +++++++ 2 files changed, 14 insertions(+) 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 = [include_directories(drv_path)] # set up internal deps. Drivers can append/override as necessary deps = std_deps + optional_deps = [] # 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 = ext_deps static_deps = ext_deps + foreach d:optional_deps + #if optional dep exists, add it to the deps list + if is_variable('shared_rte_' + d) + deps += d + endif + endforeach foreach d:deps if not build break diff --git a/lib/meson.build b/lib/meson.build index 72e9138d14..733412c276 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -140,6 +140,7 @@ foreach l:libraries # external package/library requirements ext_deps = [] deps = [] + optional_deps = [] # eal is standard dependency once built if dpdk_conf.has('RTE_LIB_EAL') deps += ['eal'] @@ -177,6 +178,12 @@ foreach l:libraries shared_deps = ext_deps static_deps = ext_deps + foreach d:optional_deps + #if optional dep exists, add it to the deps list + if is_variable('shared_rte_' + d) + deps += d + endif + endforeach foreach d:deps if not build break -- 2.40.1