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 # list of all example apps. Keep 1-3 per line, in alphabetical order.
38 'link_status_interrupt',
39 'multi_process/client_server_mp/mp_client',
40 'multi_process/client_server_mp/mp_server',
41 'multi_process/hotplug_mp',
42 'multi_process/simple_mp',
43 'multi_process/symmetric_mp',
46 'performance-thread/l3fwd-thread',
47 'performance-thread/pthread_shim',
53 'server_node_efd/node',
54 'server_node_efd/server',
63 'vm_power_manager/guest_cli',
68 # on install, skip copying all meson.build files
69 ex_file_excludes = ['meson.build']
70 foreach ex:all_examples
71 ex_file_excludes += [ex + '/meson.build']
74 if get_option('examples') == ''
78 if get_option('examples').to_lower() == 'all'
79 examples = all_examples
80 allow_skips = true # don't flag an error if we can't build an app
82 examples = get_option('examples').split(',')
83 allow_skips = false # error out if we can't build a requested app
85 default_cflags = machine_args
86 if cc.has_argument('-Wno-format-truncation')
87 default_cflags += '-Wno-format-truncation'
89 default_ldflags = dpdk_extra_ldflags
90 if get_option('default_library') == 'static' and not is_windows
91 default_ldflags += ['-Wl,--export-dynamic']
94 foreach example: examples
95 name = example.split('/')[-1]
98 allow_experimental_apis = false
99 cflags = default_cflags
100 ldflags = default_ldflags
103 includes = [include_directories(example)]
104 deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
109 error('Cannot build requested example "' + name + '"')
111 message('Skipping example "' + name + '"')
117 var_name = get_option('default_library') + '_rte_' + d
118 if not is_variable(var_name)
119 error('Missing dependency "@0@" for example "@1@"'.format(d, name))
121 dep_objs += [get_variable(var_name)]
123 if allow_experimental_apis
124 cflags += '-DALLOW_EXPERIMENTAL_API'
126 executable('dpdk-' + name, sources,
127 include_directories: includes,
128 link_whole: link_whole_libs,
131 dependencies: dep_objs)