xref: /dpdk/app/meson.build (revision 3c2ca0a9)
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright(c) 2017-2019 Intel Corporation
3
4apps = [
5        'dumpcap',
6        'pdump',
7        'proc-info',
8        'test-acl',
9        'test-bbdev',
10        'test-cmdline',
11        'test-compress-perf',
12        'test-crypto-perf',
13        'test-eventdev',
14        'test-fib',
15        'test-flow-perf',
16        'test-pipeline',
17        'test-pmd',
18        'test-regex',
19        'test-sad',
20]
21
22default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
23default_ldflags = []
24if get_option('default_library') == 'static' and not is_windows
25    default_ldflags += ['-Wl,--export-dynamic']
26endif
27
28foreach app:apps
29    build = true
30    name = app
31    sources = []
32    includes = []
33    cflags = default_cflags
34    ldflags = default_ldflags
35    objs = [] # other object files to link against, used e.g. for
36              # instruction-set optimized versions of code
37
38    # use "deps" for internal DPDK dependencies, and "ext_deps" for
39    # external package/library requirements
40    ext_deps = []
41    deps = []
42
43    subdir(name)
44
45    if not build
46        continue
47    endif
48
49    dep_objs = []
50    foreach d:deps
51        dep_objs += get_variable(get_option('default_library') + '_rte_' + d)
52    endforeach
53
54    link_libs = []
55    if get_option('default_library') == 'static'
56        link_libs = dpdk_static_libraries + dpdk_drivers
57    endif
58
59    executable('dpdk-' + name,
60            sources,
61            c_args: cflags,
62            link_args: ldflags,
63            link_whole: link_libs,
64            dependencies: dep_objs,
65            include_directories: includes,
66            install_rpath: join_paths(get_option('prefix'), driver_install_path),
67            install: true)
68endforeach
69
70# special case the autotests
71subdir('test')
72