f-stack/dpdk/app/meson.build

110 lines
3.0 KiB
Meson
Raw Normal View History

2019-06-25 11:12:58 +00:00
# SPDX-License-Identifier: BSD-3-Clause
2020-06-18 16:55:50 +00:00
# Copyright(c) 2017-2019 Intel Corporation
2019-06-25 11:12:58 +00:00
2023-09-13 12:21:49 +00:00
disable_apps = ',' + get_option('disable_apps')
disable_apps = run_command(list_dir_globs, disable_apps, check: true).stdout().split()
enable_apps = ',' + get_option('enable_apps')
enable_apps = run_command(list_dir_globs, enable_apps, check: true).stdout().split()
if enable_apps.length() == 0
enable_apps = run_command(list_dir_globs, '*', check: true).stdout().split()
endif
2020-06-18 16:55:50 +00:00
apps = [
2022-09-06 04:00:10 +00:00
'dumpcap',
'pdump',
'proc-info',
'test-acl',
'test-bbdev',
'test-cmdline',
'test-compress-perf',
'test-crypto-perf',
'test-eventdev',
'test-fib',
'test-flow-perf',
'test-gpudev',
'test-pipeline',
'test-pmd',
'test-regex',
'test-sad',
2023-09-13 12:21:49 +00:00
'test-security-perf',
2022-09-06 04:00:10 +00:00
]
2019-06-25 11:12:58 +00:00
2021-02-05 08:48:47 +00:00
default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
2022-09-02 04:40:05 +00:00
default_ldflags = []
if get_option('default_library') == 'static' and not is_windows
2022-09-06 04:00:10 +00:00
default_ldflags += ['-Wl,--export-dynamic']
2022-09-02 04:40:05 +00:00
endif
2019-06-25 11:12:58 +00:00
2023-09-13 12:21:49 +00:00
enabled_apps = [] # used to print summary at the end
2019-06-25 11:12:58 +00:00
foreach app:apps
2022-09-06 04:00:10 +00:00
name = app
2023-09-13 12:21:49 +00:00
build = true
reason = '<unknown reason>' # set if build == false to explain
2022-09-06 04:00:10 +00:00
sources = []
includes = []
cflags = default_cflags
ldflags = default_ldflags
objs = [] # other object files to link against, used e.g. for
# instruction-set optimized versions of code
# use "deps" for internal DPDK dependencies, and "ext_deps" for
# external package/library requirements
ext_deps = []
deps = []
2019-06-25 11:12:58 +00:00
2023-09-13 12:21:49 +00:00
if not enable_apps.contains(app)
build = false
reason = 'not in enabled apps build config'
elif disable_apps.contains(app)
build = false
reason = 'explicitly disabled via build config'
endif
if build
subdir(name)
endif
2019-06-25 11:12:58 +00:00
2022-09-06 04:00:10 +00:00
if build
dep_objs = []
foreach d:deps
var_name = get_option('default_library') + '_rte_' + d
if not is_variable(var_name)
build = false
2023-09-13 12:21:49 +00:00
reason = 'missing internal dependency, "@0@"'.format(d)
2022-09-06 04:00:10 +00:00
message('Missing dependency "@0@" for app "@1@"'.format(d, name))
break
endif
dep_objs += [get_variable(var_name)]
endforeach
endif
2019-06-25 11:12:58 +00:00
2022-09-06 04:00:10 +00:00
if not build
2023-09-13 12:21:49 +00:00
if reason != ''
dpdk_apps_disabled += app
2024-10-17 10:26:34 +00:00
set_variable('app_' + app.underscorify() + '_disable_reason', reason)
2023-09-13 12:21:49 +00:00
endif
2022-09-06 04:00:10 +00:00
continue
endif
2019-06-25 11:12:58 +00:00
2023-09-13 12:21:49 +00:00
enabled_apps += app
2022-09-06 04:00:10 +00:00
link_libs = []
if get_option('default_library') == 'static'
link_libs = dpdk_static_libraries + dpdk_drivers
endif
2019-06-25 11:12:58 +00:00
2022-09-06 04:00:10 +00:00
executable('dpdk-' + name,
sources,
c_args: cflags,
link_args: ldflags,
link_whole: link_libs,
dependencies: ext_deps + dep_objs,
include_directories: includes,
install_rpath: join_paths(get_option('prefix'), driver_install_path),
install: true)
2019-06-25 11:12:58 +00:00
endforeach
2020-06-18 16:55:50 +00:00
# special case the autotests
subdir('test')