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',
51 'server_node_efd/node',
52 'server_node_efd/server',
61 'vm_power_manager/guest_cli',
66 # on install, skip copying all meson.build files
67 ex_file_excludes = ['meson.build']
68 foreach ex:all_examples
69 ex_file_excludes += [ex + '/meson.build']
72 if get_option('examples') == ''
76 if get_option('examples').to_lower() == 'all'
77 examples = all_examples
78 allow_skips = true # don't flag an error if we can't build an app
80 examples = get_option('examples').split(',')
81 allow_skips = false # error out if we can't build a requested app
83 default_cflags = machine_args
84 if cc.has_argument('-Wno-format-truncation')
85 default_cflags += '-Wno-format-truncation'
87 default_ldflags = dpdk_extra_ldflags
88 if get_option('default_library') == 'static' and not is_windows
89 default_ldflags += ['-Wl,--export-dynamic']
92 foreach example: examples
93 name = example.split('/')[-1]
96 allow_experimental_apis = false
97 cflags = default_cflags
98 ldflags = default_ldflags
101 includes = [include_directories(example)]
102 deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
108 var_name = get_option('default_library') + '_rte_' + d
109 if not is_variable(var_name)
111 message('Missing dependency "@0@" for example "@1@"'.format(d, name))
114 dep_objs += [get_variable(var_name)]
120 error('Cannot build requested example "' + name + '"')
122 message('Skipping example "' + name + '"')
126 if allow_experimental_apis
127 cflags += '-DALLOW_EXPERIMENTAL_API'
129 executable('dpdk-' + name, sources,
130 include_directories: includes,
131 link_whole: link_whole_libs,
134 dependencies: dep_objs)