3a34ebbf3a6f5f2fe46b1c252d84072ec07db6fc
[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-pmd']
14
15 # for BSD only
16 lib_execinfo = cc.find_library('execinfo', required: false)
17
18 default_cflags = machine_args
19
20 # specify -D_GNU_SOURCE unconditionally
21 default_cflags += '-D_GNU_SOURCE'
22
23 foreach app:apps
24         build = true
25         name = app
26         allow_experimental_apis = false
27         sources = []
28         includes = []
29         cflags = default_cflags
30         objs = [] # other object files to link against, used e.g. for
31                   # instruction-set optimized versions of code
32
33         # use "deps" for internal DPDK dependencies, and "ext_deps" for
34         # external package/library requirements
35         ext_deps = []
36         deps = dpdk_app_link_libraries
37
38         subdir(name)
39
40         if build
41                 dep_objs = []
42                 foreach d:deps
43                         dep_objs += get_variable(get_option('default_library')
44                                  + '_rte_' + d)
45                 endforeach
46                 dep_objs += lib_execinfo
47
48                 link_libs = []
49                 if get_option('default_library') == 'static'
50                         link_libs = dpdk_static_libraries + dpdk_drivers
51                 endif
52
53                 if allow_experimental_apis
54                         cflags += '-DALLOW_EXPERIMENTAL_API'
55                 endif
56
57                 executable('dpdk-' + name,
58                                 sources,
59                                 c_args: cflags,
60                                 link_whole: link_libs,
61                                 dependencies: dep_objs,
62                                 install_rpath: join_paths(get_option('prefix'),
63                                                  driver_install_path),
64                                 install: true)
65         endif
66 endforeach