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