1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017-2019 Intel Corporation
5 if get_option('default_library') == 'static'
6 driver_libs = dpdk_drivers
9 execinfo = cc.find_library('execinfo', required: false)
11 # list of all example apps. Keep 1-3 per line, in alphabetical order.
15 'distributor', 'ethtool',
17 'fips_validation', 'flow_classify',
18 'flow_filtering', 'helloworld',
19 'ip_fragmentation', 'ip_pipeline',
20 'ip_reassembly', 'ipsec-secgw',
21 'ipv4_multicast', 'kni',
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/l3fwd-thread',
34 'performance-thread/pthread_shim',
36 'qos_meter', 'qos_sched',
38 'server_node_efd/node',
39 'server_node_efd/server',
41 'skeleton', 'tep_termination',
43 'vhost', 'vhost_crypto',
45 'vm_power_manager/guest_cli',
48 # install all example code on install - irrespective of whether the example in
49 # question is to be built as part of this build or not.
50 foreach ex:all_examples
52 install_dir: get_option('datadir') + '/dpdk/examples',
53 exclude_files: 'meson.build')
56 if get_option('examples') == ''
60 if get_option('examples').to_lower() == 'all'
61 examples = all_examples
62 allow_skips = true # don't flag an error if we can't build an app
64 examples = get_option('examples').split(',')
65 allow_skips = false # error out if we can't build a requested app
67 default_cflags = machine_args
68 if cc.has_argument('-Wno-format-truncation')
69 default_cflags += '-Wno-format-truncation'
72 foreach example: examples
73 name = example.split('/')[-1]
76 allow_experimental_apis = false
77 cflags = default_cflags
80 includes = [include_directories(example)]
81 deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
83 deps = ['eal'] # only supported lib on Windows currently
90 var_name = get_option('default_library') + '_rte_' + d
91 if not is_variable(var_name)
92 error('Missing dependency "@0@" for example "@1@"'.format(d, name))
94 dep_objs += [get_variable(var_name)]
96 if allow_experimental_apis
97 cflags += '-DALLOW_EXPERIMENTAL_API'
99 executable('dpdk-' + name, sources,
100 include_directories: includes,
101 link_whole: driver_libs,
102 link_args: dpdk_extra_ldflags,
104 dependencies: dep_objs)
106 error('Cannot build requested example "' + name + '"')
108 message('Skipping example "' + name + '"')