build: add workarounds for Windows helloworld
[dpdk.git] / app / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017-2019 Intel Corporation
3
4 if host_machine.system() == '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-pipeline',
18         'test-pmd']
19
20 # for BSD only
21 lib_execinfo = cc.find_library('execinfo', required: false)
22
23 default_cflags = machine_args
24
25 # specify -D_GNU_SOURCE unconditionally
26 default_cflags += '-D_GNU_SOURCE'
27
28 foreach app:apps
29         build = true
30         name = app
31         allow_experimental_apis = false
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 = dpdk_app_link_libraries
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                 if allow_experimental_apis
59                         cflags += '-DALLOW_EXPERIMENTAL_API'
60                 endif
61
62                 executable('dpdk-' + name,
63                                 sources,
64                                 c_args: cflags,
65                                 link_whole: link_libs,
66                                 dependencies: dep_objs,
67                                 install_rpath: join_paths(get_option('prefix'),
68                                                  driver_install_path),
69                                 install: true)
70         endif
71 endforeach
72
73 # special case the autotests
74 subdir('test')