xref: /dpdk/app/meson.build (revision 64be0e77)
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-gpudev',
17        'test-pipeline',
18        'test-pmd',
19        'test-regex',
20        'test-sad',
21]
22
23default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
24default_ldflags = []
25if get_option('default_library') == 'static' and not is_windows
26    default_ldflags += ['-Wl,--export-dynamic']
27endif
28
29foreach app:apps
30    build = true
31    name = app
32    sources = []
33    includes = []
34    cflags = default_cflags
35    ldflags = default_ldflags
36    objs = [] # other object files to link against, used e.g. for
37              # instruction-set optimized versions of code
38
39    # use "deps" for internal DPDK dependencies, and "ext_deps" for
40    # external package/library requirements
41    ext_deps = []
42    deps = []
43
44    subdir(name)
45
46    if not build
47        continue
48    endif
49
50    dep_objs = []
51    foreach d:deps
52        dep_objs += get_variable(get_option('default_library') + '_rte_' + d)
53    endforeach
54
55    link_libs = []
56    if get_option('default_library') == 'static'
57        link_libs = dpdk_static_libraries + dpdk_drivers
58    endif
59
60    executable('dpdk-' + name,
61            sources,
62            c_args: cflags,
63            link_args: ldflags,
64            link_whole: link_libs,
65            dependencies: ext_deps + dep_objs,
66            include_directories: includes,
67            install_rpath: join_paths(get_option('prefix'), driver_install_path),
68            install: true)
69endforeach
70
71# special case the autotests
72subdir('test')
73