1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017 Intel Corporation
5 if get_option('default_library') == 'static'
6 driver_libs = dpdk_drivers
9 execinfo = cc.find_library('execinfo', required: false)
11 allow_skips = true # don't flag an error if we can't build an app
13 if get_option('examples').to_lower() == 'all'
14 dirs = run_command('sh', '-c',
15 'cd $MESON_SOURCE_ROOT/$MESON_SUBDIR && for d in * ; do if [ -d $d ] ; then echo $d ; fi ; done')
16 examples = dirs.stdout().split()
18 examples = get_option('examples').split(',')
19 allow_skips = false # error out if we can't build a requested app
21 foreach example: examples
25 allow_experimental_apis = false
28 includes = [include_directories(example)]
29 deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
35 var_name = get_option('default_library') + '_rte_' + d
36 if not is_variable(var_name)
37 error('Missing dependency "@0@" for example "@1@"'.format(d, name))
39 dep_objs += [get_variable(var_name)]
41 if allow_experimental_apis
42 cflags += '-DALLOW_EXPERIMENTAL_API'
44 executable('dpdk-' + name, sources,
45 include_directories: includes,
46 link_whole: driver_libs,
47 link_args: dpdk_extra_ldflags,
49 dependencies: dep_objs)
51 error('Cannot build requested example "' + name + '"')
53 message('Skipping example "' + name + '"')