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 2750845903; Wed, 4 Sep 2024 17:08:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D18BD4275A; Wed, 4 Sep 2024 17:08:46 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by mails.dpdk.org (Postfix) with ESMTP id A175842670 for ; Wed, 4 Sep 2024 17:08:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725462525; x=1756998525; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=YIzhZVqttpyLC/oZ99Aq57/Z6OlfuAei26N47e0613o=; b=OAxdltrawCuoAociKprGZZVfHpcqFyFrzxt6kp1n7sE6fNFJV92w6Qp7 DCPygZKBQp8WekSmAuKI0jHE/72ZwVG7mFopQzuALd7G8FNvePwbpnvxZ bZnFH/I558KIL5g7NoeAzLjAB8OhdBmbx8vlRW0dBjr89TdHRxwBvLTVj /6sUzDD/6JusxYG0tGztefA6wuzXFX56QlAmqoTkRJ0a9kxlQWEYYQxNc wCMu4vh0j03QPAKd7OHbDyBrDss1SmNPf/lRSs6zbR2RyKsEBvHJfaXzs bU2qv+/NvCl8B8ocXybC6k5TUVAD4I8sI3hEJF+cZ9T+nESF+3M5BP4KN w==; X-CSE-ConnectionGUID: pgHWThjhR2SPHbcNMjMWpw== X-CSE-MsgGUID: GZLEsZX7Q8eaWNx+EEm3Bg== X-IronPort-AV: E=McAfee;i="6700,10204,11185"; a="23641070" X-IronPort-AV: E=Sophos;i="6.10,202,1719903600"; d="scan'208";a="23641070" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2024 08:08:44 -0700 X-CSE-ConnectionGUID: RlzOOXo5Q0KcgvRlo9E0Bg== X-CSE-MsgGUID: 7/8z8lFNTZWb0xTij5ySHg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,202,1719903600"; d="scan'208";a="96107835" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa001.fm.intel.com with ESMTP; 04 Sep 2024 08:08:42 -0700 From: Anatoly Burakov To: dev@dpdk.org, Reshma Pattan , Nicolas Chautru , Brian Dooley , Aman Singh , Akhil Goyal , Fan Zhang , David Hunt , Sivaprasad Tummala Subject: [PATCH v3 1/8] build: split dependencies into mandatory and optional Date: Wed, 4 Sep 2024 16:08:29 +0100 Message-ID: <69a7b78dd7cb91892620b129ac5cf3a7f7e09e2b.1725462264.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: <20240730145508.551075-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 Allow specifying dependencies as either mandatory or optional. This does not change anything about the build, but it is useful for tooling to know if a dependency is required or not. Signed-off-by: Anatoly Burakov --- app/meson.build | 3 ++- app/proc-info/meson.build | 2 +- app/test-bbdev/meson.build | 8 ++++---- app/test-crypto-perf/meson.build | 2 +- app/test-pmd/meson.build | 26 +++++++++++++------------- app/test/meson.build | 12 ++++++------ drivers/meson.build | 3 ++- examples/ethtool/meson.build | 2 +- examples/l2fwd-crypto/meson.build | 2 +- examples/l3fwd/meson.build | 2 +- examples/meson.build | 3 ++- examples/vm_power_manager/meson.build | 6 +++--- lib/meson.build | 3 ++- 13 files changed, 39 insertions(+), 35 deletions(-) diff --git a/app/meson.build b/app/meson.build index 5b2c80c7a1..1c61cd862c 100644 --- a/app/meson.build +++ b/app/meson.build @@ -65,6 +65,7 @@ foreach app:apps # external package/library requirements ext_deps = [] deps = [] + optional_deps = [] if not enable_apps.contains(app) build = false @@ -84,7 +85,7 @@ foreach app:apps if build dep_objs = [] - foreach d:deps + foreach d:deps + optional_deps var_name = get_option('default_library') + '_rte_' + d if not is_variable(var_name) build = false diff --git a/app/proc-info/meson.build b/app/proc-info/meson.build index 4f83f29a64..156592119b 100644 --- a/app/proc-info/meson.build +++ b/app/proc-info/meson.build @@ -10,5 +10,5 @@ endif sources = files('main.c') deps += ['ethdev', 'security', 'eventdev'] if dpdk_conf.has('RTE_LIB_METRICS') - deps += 'metrics' + optional_deps += 'metrics' endif diff --git a/app/test-bbdev/meson.build b/app/test-bbdev/meson.build index 926e0a5271..c26e46a987 100644 --- a/app/test-bbdev/meson.build +++ b/app/test-bbdev/meson.build @@ -15,14 +15,14 @@ sources = files( ) deps += ['bbdev', 'bus_vdev'] if dpdk_conf.has('RTE_BASEBAND_FPGA_LTE_FEC') - deps += ['baseband_fpga_lte_fec'] + optional_deps += ['baseband_fpga_lte_fec'] endif if dpdk_conf.has('RTE_BASEBAND_FPGA_5GNR_FEC') - deps += ['baseband_fpga_5gnr_fec'] + optional_deps += ['baseband_fpga_5gnr_fec'] endif if dpdk_conf.has('RTE_BASEBAND_ACC') - deps += ['baseband_acc'] + optional_deps += ['baseband_acc'] endif if dpdk_conf.has('RTE_BASEBAND_LA12XX') - deps += ['baseband_la12xx'] + optional_deps += ['baseband_la12xx'] endif diff --git a/app/test-crypto-perf/meson.build b/app/test-crypto-perf/meson.build index 7b02b518f0..05c71e0a0c 100644 --- a/app/test-crypto-perf/meson.build +++ b/app/test-crypto-perf/meson.build @@ -21,5 +21,5 @@ sources = files( ) deps += ['cryptodev', 'net', 'security'] if dpdk_conf.has('RTE_CRYPTO_SCHEDULER') - deps += 'crypto_scheduler' + optional_deps += 'crypto_scheduler' endif diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build index 719f875be0..5559829e09 100644 --- a/app/test-pmd/meson.build +++ b/app/test-pmd/meson.build @@ -36,44 +36,44 @@ endif deps += ['ethdev', 'cmdline'] if dpdk_conf.has('RTE_CRYPTO_SCHEDULER') - deps += 'crypto_scheduler' + optional_deps += 'crypto_scheduler' endif if dpdk_conf.has('RTE_LIB_BITRATESTATS') - deps += 'bitratestats' + optional_deps += 'bitratestats' endif if dpdk_conf.has('RTE_LIB_BPF') sources += files('bpf_cmd.c') - deps += 'bpf' + optional_deps += 'bpf' endif if dpdk_conf.has('RTE_LIB_GRO') - deps += 'gro' + optional_deps += 'gro' endif if dpdk_conf.has('RTE_LIB_GSO') - deps += 'gso' + optional_deps += 'gso' endif if dpdk_conf.has('RTE_LIB_LATENCYSTATS') - deps += 'latencystats' + optional_deps += 'latencystats' endif if dpdk_conf.has('RTE_LIB_METRICS') - deps += 'metrics' + optional_deps += 'metrics' endif if dpdk_conf.has('RTE_LIB_PDUMP') - deps += 'pdump' + optional_deps += 'pdump' endif if dpdk_conf.has('RTE_NET_BNXT') - deps += 'net_bnxt' + optional_deps += 'net_bnxt' endif if dpdk_conf.has('RTE_NET_I40E') - deps += 'net_i40e' + optional_deps += 'net_i40e' endif if dpdk_conf.has('RTE_NET_IXGBE') - deps += 'net_ixgbe' + optional_deps += 'net_ixgbe' endif if dpdk_conf.has('RTE_NET_DPAA') - deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa'] + optional_deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa'] endif # Driver-specific commands are located in driver directories. includes = include_directories('.') sources += testpmd_drivers_sources -deps += testpmd_drivers_deps +optional_deps += testpmd_drivers_deps diff --git a/app/test/meson.build b/app/test/meson.build index e29258e6ec..bb0a38b3a5 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -7,7 +7,7 @@ sources += files('commands.c', 'test.c') # optional dependencies: some files may use these - and so we should link them in - # but do not explicitly require them so they are not listed in the per-file lists below -optional_deps = ['crypto_scheduler', 'lpm'] +opt_deps = ['crypto_scheduler', 'lpm'] # some other utility C files, providing functions used by various tests # so we need to include these deps in the dependency list for the files using those fns. @@ -217,8 +217,8 @@ foreach f, f_deps : source_file_deps break else # technically we might not need this dep, but adding it is harmless - if d not in deps - deps += d + if d not in optional_deps + optional_deps += d endif endif endforeach @@ -239,9 +239,9 @@ foreach f, f_deps : source_file_deps endif endforeach # add the optional dependencies -foreach d:optional_deps - if is_variable(def_lib + '_rte_' + d) and d not in deps - deps += d +foreach d:opt_deps + if is_variable(def_lib + '_rte_' + d) and d not in optional_deps + optional_deps += d endif endforeach diff --git a/drivers/meson.build b/drivers/meson.build index 66931d4241..b9a18a5986 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -128,6 +128,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 @@ -169,7 +170,7 @@ foreach subpath:subdirs # get dependency objs from strings shared_deps = ext_deps static_deps = ext_deps - foreach d:deps + foreach d:deps + optional_deps if not build break endif diff --git a/examples/ethtool/meson.build b/examples/ethtool/meson.build index d7f63d48af..e8638a8607 100644 --- a/examples/ethtool/meson.build +++ b/examples/ethtool/meson.build @@ -20,7 +20,7 @@ includes = include_directories('lib', 'ethtool-app') deps += 'bus_pci' if dpdk_conf.has('RTE_NET_IXGBE') - deps += 'net_ixgbe' + optional_deps += 'net_ixgbe' endif allow_experimental_apis = true diff --git a/examples/l2fwd-crypto/meson.build b/examples/l2fwd-crypto/meson.build index bb44c88882..f16ebadc74 100644 --- a/examples/l2fwd-crypto/meson.build +++ b/examples/l2fwd-crypto/meson.build @@ -8,7 +8,7 @@ deps += 'cryptodev' if dpdk_conf.has('RTE_CRYPTO_SCHEDULER') - deps += 'crypto_scheduler' + optional_deps += 'crypto_scheduler' endif allow_experimental_apis = true sources = files( diff --git a/examples/l3fwd/meson.build b/examples/l3fwd/meson.build index c25de77bba..5938452607 100644 --- a/examples/l3fwd/meson.build +++ b/examples/l3fwd/meson.build @@ -19,5 +19,5 @@ sources = files( 'main.c', ) if dpdk_conf.has('RTE_LIB_EVENTDEV') - deps += 'eventdev' + optional_deps += 'eventdev' endif diff --git a/examples/meson.build b/examples/meson.build index 8e8968a1fa..82151d09b4 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -98,11 +98,12 @@ foreach example: examples ext_deps = [] includes = [include_directories(example, 'common')] deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline'] + optional_deps = [] subdir(example) if build dep_objs = ext_deps - foreach d:deps + foreach d:deps + optional_deps var_name = get_option('default_library') + '_rte_' + d if not is_variable(var_name) build = false diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build index b866d8fd54..25e5bcb71b 100644 --- a/examples/vm_power_manager/meson.build +++ b/examples/vm_power_manager/meson.build @@ -9,15 +9,15 @@ deps += ['power'] if dpdk_conf.has('RTE_NET_BNXT') - deps += ['net_bnxt'] + optional_deps += ['net_bnxt'] endif if dpdk_conf.has('RTE_NET_I40E') - deps += ['net_i40e'] + optional_deps += ['net_i40e'] endif if dpdk_conf.has('RTE_NET_IXGBE') - deps += ['net_ixgbe'] + optional_deps += ['net_ixgbe'] endif allow_experimental_apis = true diff --git a/lib/meson.build b/lib/meson.build index 162287753f..7916deadd9 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -134,6 +134,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'] @@ -171,7 +172,7 @@ foreach l:libraries shared_deps = ext_deps static_deps = ext_deps - foreach d:deps + foreach d:deps + optional_deps if not build break endif -- 2.43.5