From patchwork Wed Oct 12 14:47:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 118073 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 87C1EA0543; Wed, 12 Oct 2022 16:47:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3CBEA43027; Wed, 12 Oct 2022 16:47:09 +0200 (CEST) Received: from smail.rz.tu-ilmenau.de (smail.rz.tu-ilmenau.de [141.24.186.67]) by mails.dpdk.org (Postfix) with ESMTP id AB97442EF7 for ; Wed, 12 Oct 2022 16:47:07 +0200 (CEST) Received: from localhost.localdomain (dialin-ip-23-165.ilmenau.net [80.88.23.165]) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPA id 55CF0580098; Wed, 12 Oct 2022 16:47:07 +0200 (CEST) From: Markus Theil To: dev@dpdk.org Cc: Bruce Richardson , Markus Theil Subject: [PATCH 1/2] build: allow to conditionally build apps Date: Wed, 12 Oct 2022 16:47:03 +0200 Message-Id: <20221012144704.77973-1-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 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 Makes apps configureable from meson, like already possible for drivers. Signed-off-by: Markus Theil --- app/meson.build | 17 ++++++++++++----- meson_options.txt | 4 ++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/meson.build b/app/meson.build index 93d8c15032..4d9c8ee814 100644 --- a/app/meson.build +++ b/app/meson.build @@ -1,6 +1,9 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017-2019 Intel Corporation +enabled_apps = get_option('enable_apps') +disabled_apps = get_option('disable_apps') + apps = [ 'dumpcap', 'pdump', @@ -27,7 +30,11 @@ if get_option('default_library') == 'static' and not is_windows endif foreach app:apps - build = true + build = enabled_apps == '' or enabled_apps.contains(app) + # let disabled_apps override enabled_apps + if disabled_apps != '' + build = build and not disabled_apps.contains(app) + endif name = app sources = [] includes = [] @@ -41,6 +48,10 @@ foreach app:apps ext_deps = [] deps = [] + if not build + continue + endif + subdir(name) if build @@ -56,10 +67,6 @@ foreach app:apps endforeach endif - if not build - continue - endif - link_libs = [] if get_option('default_library') == 'static' link_libs = dpdk_static_libraries + dpdk_drivers diff --git a/meson_options.txt b/meson_options.txt index 0574dd0fff..9f032d454d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,6 +6,8 @@ option('cpu_instruction_set', type: 'string', value: 'auto', description: 'Set the target machine ISA (instruction set architecture). Will be set according to the platform option by default.') option('developer_mode', type: 'feature', description: 'turn on additional build checks relevant for DPDK developers') +option('disable_apps', type: 'string', value: '', description: + 'Comma-separated list of apps to explicitly disable.') option('disable_drivers', type: 'string', value: '', description: 'Comma-separated list of drivers to explicitly disable.') option('disable_libs', type: 'string', value: 'kni', description: @@ -14,6 +16,8 @@ option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-', d 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.') option('enable_docs', type: 'boolean', value: false, description: 'build documentation') +option('enable_apps', type: 'string', value: '', description: + 'Comma-separated list of apps to build. If unspecified, build all apps.') option('enable_drivers', type: 'string', value: '', description: 'Comma-separated list of drivers to build. If unspecified, build all drivers.') option('enable_driver_sdk', type: 'boolean', value: false, description: From patchwork Wed Oct 12 14:47:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 118074 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C23DDA0543; Wed, 12 Oct 2022 16:47:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1970243096; Wed, 12 Oct 2022 16:47:12 +0200 (CEST) Received: from smail.rz.tu-ilmenau.de (smail.rz.tu-ilmenau.de [141.24.186.67]) by mails.dpdk.org (Postfix) with ESMTP id EDD8B43096 for ; Wed, 12 Oct 2022 16:47:10 +0200 (CEST) Received: from localhost.localdomain (dialin-ip-23-165.ilmenau.net [80.88.23.165]) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPA id 9D6EE580099; Wed, 12 Oct 2022 16:47:10 +0200 (CEST) From: Markus Theil To: dev@dpdk.org Cc: Bruce Richardson , Thorben Roemer Subject: [PATCH 2/2] build: export dpdk_includes for subproject usage. Date: Wed, 12 Oct 2022 16:47:04 +0200 Message-Id: <20221012144704.77973-2-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221012144704.77973-1-markus.theil@tu-ilmenau.de> References: <20221012144704.77973-1-markus.theil@tu-ilmenau.de> MIME-Version: 1.0 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: Thorben Roemer In order to perform things like LTO more easily in our DPDK applications, we use DPDK as a meson subproject. Also export includes in order to be usable in this context. Signed-off-by: Thorben Roemer --- drivers/meson.build | 1 + lib/meson.build | 1 + meson.build | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/meson.build b/drivers/meson.build index 216971f4e2..d19b47df12 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -95,6 +95,7 @@ foreach subpath:subdirs objs = [] cflags = default_cflags includes = [include_directories(drv_path)] + dpdk_includes += [include_directories(drv_path)] # set up internal deps. Drivers can append/override as necessary deps = std_deps # ext_deps: Stores external library dependency got diff --git a/lib/meson.build b/lib/meson.build index f858844fa2..85113d0b47 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -190,6 +190,7 @@ foreach l:libraries libname = 'rte_' + name includes += include_directories(l) + dpdk_includes += include_directories(l) if developer_mode and is_windows and use_function_versioning message('@0@: Function versioning is not supported by Windows.'.format(name)) diff --git a/meson.build b/meson.build index 1d35a255c3..d1cf039297 100644 --- a/meson.build +++ b/meson.build @@ -32,6 +32,7 @@ cc = meson.get_compiler('c') dpdk_source_root = meson.current_source_dir() dpdk_build_root = meson.current_build_dir() dpdk_conf = configuration_data() +dpdk_includes = [] dpdk_libraries = [] dpdk_static_libraries = [] dpdk_shared_lib_deps = []