aa353f6572b742f894e5e8310e3bae10d8667e23
[dpdk.git] / app / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017 Intel Corporation
3
4 apps = [
5         'pdump',
6         'proc-info',
7         'test-acl',
8         'test-bbdev',
9         'test-cmdline',
10         'test-compress-perf',
11         'test-crypto-perf',
12         'test-eventdev',
13         'test-pipeline',
14         'test-pmd']
15
16 # for BSD only
17 lib_execinfo = cc.find_library('execinfo', required: false)
18
19 default_cflags = machine_args
20
21 # specify -D_GNU_SOURCE unconditionally
22 default_cflags += '-D_GNU_SOURCE'
23
24 foreach app:apps
25         build = true
26         name = app
27         allow_experimental_apis = false
28         sources = []
29         includes = []
30         cflags = default_cflags
31         objs = [] # other object files to link against, used e.g. for
32                   # instruction-set optimized versions of code
33
34         # use "deps" for internal DPDK dependencies, and "ext_deps" for
35         # external package/library requirements
36         ext_deps = []
37         deps = dpdk_app_link_libraries
38
39         subdir(name)
40
41         if build
42                 dep_objs = []
43                 foreach d:deps
44                         dep_objs += get_variable(get_option('default_library')
45                                  + '_rte_' + d)
46                 endforeach
47                 dep_objs += lib_execinfo
48
49                 link_libs = []
50                 if get_option('default_library') == 'static'
51                         link_libs = dpdk_static_libraries + dpdk_drivers
52                 endif
53
54                 if allow_experimental_apis
55                         cflags += '-DALLOW_EXPERIMENTAL_API'
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')