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.
37 'link_status_interrupt',
38 'multi_process/client_server_mp/mp_client',
39 'multi_process/client_server_mp/mp_server',
40 'multi_process/hotplug_mp',
41 'multi_process/simple_mp',
42 'multi_process/symmetric_mp',
50 'server_node_efd/node',
51 'server_node_efd/server',
60 'vm_power_manager/guest_cli',
65 # on install, skip copying all meson.build files
66 ex_file_excludes = ['meson.build']
67 foreach ex:all_examples
68 ex_file_excludes += [ex + '/meson.build']
71 if get_option('examples') == ''
75 if get_option('examples').to_lower() == 'all'
76 examples = all_examples
77 allow_skips = true # don't flag an error if we can't build an app
79 examples = get_option('examples').split(',')
80 allow_skips = false # error out if we can't build a requested app
82 default_cflags = machine_args
83 if cc.has_argument('-Wno-format-truncation')
84 default_cflags += '-Wno-format-truncation'
86 default_ldflags = dpdk_extra_ldflags
87 if get_option('default_library') == 'static' and not is_windows
88 default_ldflags += ['-Wl,--export-dynamic']
91 foreach example: examples
92 name = example.split('/')[-1]
95 allow_experimental_apis = false
96 cflags = default_cflags
97 ldflags = default_ldflags
100 includes = [include_directories(example)]
101 deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
107 var_name = get_option('default_library') + '_rte_' + d
108 if not is_variable(var_name)
110 message('Missing dependency "@0@" for example "@1@"'.format(d, name))
113 dep_objs += [get_variable(var_name)]
119 error('Cannot build requested example "' + name + '"')
121 message('Skipping example "' + name + '"')
125 if allow_experimental_apis
126 cflags += '-DALLOW_EXPERIMENTAL_API'
128 executable('dpdk-' + name, sources,
129 include_directories: includes,
130 link_whole: link_whole_libs,
133 dependencies: dep_objs)