examples/load_balancer: remove example
[dpdk.git] / examples / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017-2019 Intel Corporation
3
4 driver_libs = []
5 if get_option('default_library') == 'static'
6         driver_libs = dpdk_drivers
7 endif
8
9 execinfo = cc.find_library('execinfo', required: false)
10
11 # list of all example apps. Keep 1-3 per line, in alphabetical order.
12 all_examples = [
13         'bbdev_app', 'bond',
14         'bpf', 'cmdline',
15         'distributor', 'ethtool',
16         'eventdev_pipeline',
17         'fips_validation', 'flow_classify',
18         'flow_filtering', 'helloworld',
19         'ip_fragmentation', 'ip_pipeline',
20         'ip_reassembly', 'ipsec-secgw',
21         'ipv4_multicast', 'kni',
22         'l2fwd', 'l2fwd-cat',
23         'l2fwd-crypto', 'l2fwd-jobstats',
24         'l2fwd-keepalive', 'l3fwd',
25         'l3fwd-acl', 'l3fwd-power',
26         'link_status_interrupt',
27         'multi_process/client_server_mp/mp_client',
28         'multi_process/client_server_mp/mp_server',
29         'multi_process/hotplug_mp',
30         'multi_process/simple_mp',
31         'multi_process/symmetric_mp',
32         'ntb', 'packet_ordering',
33         'performance-thread', 'ptpclient',
34         'qos_meter', 'qos_sched',
35         'rxtx_callbacks',
36         'server_node_efd', 'service_cores',
37         'skeleton', 'tep_termination',
38         'timer', 'vdpa',
39         'vhost', 'vhost_crypto',
40         'vm_power_manager',
41         'vmdq', 'vmdq_dcb',
42 ]
43 # install all example code on install - irrespective of whether the example in
44 # question is to be built as part of this build or not.
45 foreach ex:all_examples
46         install_subdir(ex,
47                         install_dir: get_option('datadir') + '/dpdk/examples',
48                         exclude_files: 'meson.build')
49 endforeach
50
51 if get_option('examples') == ''
52         subdir_done()
53 endif
54
55 if get_option('examples').to_lower() == 'all'
56         examples = all_examples
57         allow_skips = true # don't flag an error if we can't build an app
58 else
59         examples = get_option('examples').split(',')
60         allow_skips = false # error out if we can't build a requested app
61 endif
62 default_cflags = machine_args
63 if cc.has_argument('-Wno-format-truncation')
64         default_cflags += '-Wno-format-truncation'
65 endif
66
67 foreach example: examples
68         name = example.split('/')[-1]
69         build = true
70         sources = []
71         allow_experimental_apis = false
72         cflags = default_cflags
73
74         ext_deps = [execinfo]
75         includes = [include_directories(example)]
76         deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
77         if is_windows
78                 deps = ['eal'] # only supported lib on Windows currently
79         endif
80         subdir(example)
81
82         if build
83                 dep_objs = ext_deps
84                 foreach d:deps
85                         var_name = get_option('default_library') + '_rte_' + d
86                         if not is_variable(var_name)
87                                 error('Missing dependency "@0@" for example "@1@"'.format(d, name))
88                         endif
89                         dep_objs += [get_variable(var_name)]
90                 endforeach
91                 if allow_experimental_apis
92                         cflags += '-DALLOW_EXPERIMENTAL_API'
93                 endif
94                 executable('dpdk-' + name, sources,
95                         include_directories: includes,
96                         link_whole: driver_libs,
97                         link_args: dpdk_extra_ldflags,
98                         c_args: cflags,
99                         dependencies: dep_objs)
100         elif not allow_skips
101                 error('Cannot build requested example "' + name + '"')
102         else
103                 message('Skipping example "' + name + '"')
104         endif
105 endforeach