1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017-2019 Intel Corporation
5 if get_option('default_library') == 'static'
6 link_whole_libs = dpdk_static_libraries + 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',
20 'ip_fragmentation', 'ip_pipeline',
21 'ip_reassembly', 'ipsec-secgw',
22 'ipv4_multicast', 'kni',
23 'l2fwd', 'l2fwd-cat', 'l2fwd-event',
24 'l2fwd-crypto', 'l2fwd-jobstats',
25 'l2fwd-keepalive', 'l3fwd',
26 'l3fwd-acl', 'l3fwd-power', 'l3fwd-graph',
27 'link_status_interrupt',
28 'multi_process/client_server_mp/mp_client',
29 'multi_process/client_server_mp/mp_server',
30 'multi_process/hotplug_mp',
31 'multi_process/simple_mp',
32 'multi_process/symmetric_mp',
33 'ntb', 'packet_ordering',
34 'performance-thread/l3fwd-thread',
35 'performance-thread/pthread_shim',
38 'qos_meter', 'qos_sched',
40 'server_node_efd/node',
41 'server_node_efd/server',
45 'vhost', 'vhost_crypto',
46 'vhost_blk', 'vm_power_manager',
47 'vm_power_manager/guest_cli',
51 # on install, skip copying all meson.build files
52 ex_file_excludes = ['meson.build']
53 foreach ex:all_examples
54 ex_file_excludes += [ex + '/meson.build']
57 if get_option('examples') == ''
61 if get_option('examples').to_lower() == 'all'
62 examples = all_examples
63 allow_skips = true # don't flag an error if we can't build an app
65 examples = get_option('examples').split(',')
66 allow_skips = false # error out if we can't build a requested app
68 default_cflags = machine_args
69 if cc.has_argument('-Wno-format-truncation')
70 default_cflags += '-Wno-format-truncation'
72 default_ldflags = dpdk_extra_ldflags
73 if get_option('default_library') == 'static' and not is_windows
74 default_ldflags += ['-Wl,--export-dynamic']
77 foreach example: examples
78 name = example.split('/')[-1]
81 allow_experimental_apis = false
82 cflags = default_cflags
83 ldflags = default_ldflags
86 includes = [include_directories(example)]
87 deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
93 var_name = get_option('default_library') + '_rte_' + d
94 if not is_variable(var_name)
95 error('Missing dependency "@0@" for example "@1@"'.format(d, name))
97 dep_objs += [get_variable(var_name)]
99 if allow_experimental_apis
100 cflags += '-DALLOW_EXPERIMENTAL_API'
102 executable('dpdk-' + name, sources,
103 include_directories: includes,
104 link_whole: link_whole_libs,
107 dependencies: dep_objs)
109 error('Cannot build requested example "' + name + '"')
111 message('Skipping example "' + name + '"')