eb74f215a3b4f9d969e3f3815b01c0b3c0b54a37
[dpdk.git] / app / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017-2019 Intel Corporation
3
4 if is_windows
5         subdir_done()
6 endif
7
8 apps = [
9         'pdump',
10         'proc-info',
11         'test-acl',
12         'test-bbdev',
13         'test-cmdline',
14         'test-compress-perf',
15         'test-crypto-perf',
16         'test-eventdev',
17         'test-fib',
18         'test-flow-perf',
19         'test-pipeline',
20         'test-pmd',
21         'test-regex',
22         'test-sad']
23
24 # for BSD only
25 lib_execinfo = cc.find_library('execinfo', required: false)
26
27 default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
28
29 foreach app:apps
30         build = true
31         name = app
32         sources = []
33         includes = []
34         cflags = default_cflags
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 build
46                 dep_objs = []
47                 foreach d:deps
48                         dep_objs += get_variable(get_option('default_library')
49                                  + '_rte_' + d)
50                 endforeach
51                 dep_objs += lib_execinfo
52
53                 link_libs = []
54                 if get_option('default_library') == 'static'
55                         link_libs = dpdk_static_libraries + dpdk_drivers
56                 endif
57
58                 executable('dpdk-' + name,
59                                 sources,
60                                 c_args: cflags,
61                                 link_whole: link_libs,
62                                 dependencies: dep_objs,
63                                 install_rpath: join_paths(get_option('prefix'),
64                                                  driver_install_path),
65                                 install: true)
66         endif
67 endforeach
68
69 # special case the autotests
70 subdir('test')