2017-12-18 15:56:25 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2019-04-02 03:54:58 +00:00
|
|
|
# Copyright(c) 2017-2019 Intel Corporation
|
examples: build some samples with meson
Add support for having selected example apps built as part of a meson,
ninja build. By default none are built, and those to be built should be
named directly in the -Dexamples='' meson configuration argument.
This is useful for developers working on a feature who want to use a
suitable example, or examples, to test that feature, as they can compile
everything up in one go, and run the example without having to do a ninja
install first.
This commit adds examples which don't consist of multiple apps in
subdirectories to the meson build, so they can be built by default by
passing -Dexamples parameter to meson.
Not included are the following examples:
* ethtool
* multi-process
* netmap_compat
* performance-thread
* quota_watermark
* server_node_efd
* vm_power_manager
To test the apps added here, use the following command, merged to one line,
to add them to your meson build (command to be run inside the build
directory):
meson configure -Dexamples=bbdev_app,bond,cmdline,distributor,\
eventdev_pipeline_sw_pmd, exception_path,helloworld,\
ip_fragmentation,ip_pipeline,ip_reassembly, ipsec-secgw,\
ipv4_multicast,kni,l2fwd-cat,l2fwd-crypto,l2fwd-jobstats,\
l2fwd-keepalive,l2fwd,l3fwd-acl,l3fwd-power,l3fwd-vf,l3fwd,\
link_status_interrupt,load_balancer,packet_ordering,ptpclient,\
qos_meter,qos_sched,rxtx_callbacks,skeleton,tep_termination,\
timer,vhost,vhost_scsi,vmdq,vmdq_dcb
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
2017-09-12 15:42:02 +00:00
|
|
|
|
2020-06-30 14:14:27 +00:00
|
|
|
link_whole_libs = []
|
examples: build some samples with meson
Add support for having selected example apps built as part of a meson,
ninja build. By default none are built, and those to be built should be
named directly in the -Dexamples='' meson configuration argument.
This is useful for developers working on a feature who want to use a
suitable example, or examples, to test that feature, as they can compile
everything up in one go, and run the example without having to do a ninja
install first.
This commit adds examples which don't consist of multiple apps in
subdirectories to the meson build, so they can be built by default by
passing -Dexamples parameter to meson.
Not included are the following examples:
* ethtool
* multi-process
* netmap_compat
* performance-thread
* quota_watermark
* server_node_efd
* vm_power_manager
To test the apps added here, use the following command, merged to one line,
to add them to your meson build (command to be run inside the build
directory):
meson configure -Dexamples=bbdev_app,bond,cmdline,distributor,\
eventdev_pipeline_sw_pmd, exception_path,helloworld,\
ip_fragmentation,ip_pipeline,ip_reassembly, ipsec-secgw,\
ipv4_multicast,kni,l2fwd-cat,l2fwd-crypto,l2fwd-jobstats,\
l2fwd-keepalive,l2fwd,l3fwd-acl,l3fwd-power,l3fwd-vf,l3fwd,\
link_status_interrupt,load_balancer,packet_ordering,ptpclient,\
qos_meter,qos_sched,rxtx_callbacks,skeleton,tep_termination,\
timer,vhost,vhost_scsi,vmdq,vmdq_dcb
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
2017-09-12 15:42:02 +00:00
|
|
|
if get_option('default_library') == 'static'
|
2021-04-20 10:22:22 +00:00
|
|
|
link_whole_libs = dpdk_static_libraries + dpdk_drivers
|
examples: build some samples with meson
Add support for having selected example apps built as part of a meson,
ninja build. By default none are built, and those to be built should be
named directly in the -Dexamples='' meson configuration argument.
This is useful for developers working on a feature who want to use a
suitable example, or examples, to test that feature, as they can compile
everything up in one go, and run the example without having to do a ninja
install first.
This commit adds examples which don't consist of multiple apps in
subdirectories to the meson build, so they can be built by default by
passing -Dexamples parameter to meson.
Not included are the following examples:
* ethtool
* multi-process
* netmap_compat
* performance-thread
* quota_watermark
* server_node_efd
* vm_power_manager
To test the apps added here, use the following command, merged to one line,
to add them to your meson build (command to be run inside the build
directory):
meson configure -Dexamples=bbdev_app,bond,cmdline,distributor,\
eventdev_pipeline_sw_pmd, exception_path,helloworld,\
ip_fragmentation,ip_pipeline,ip_reassembly, ipsec-secgw,\
ipv4_multicast,kni,l2fwd-cat,l2fwd-crypto,l2fwd-jobstats,\
l2fwd-keepalive,l2fwd,l3fwd-acl,l3fwd-power,l3fwd-vf,l3fwd,\
link_status_interrupt,load_balancer,packet_ordering,ptpclient,\
qos_meter,qos_sched,rxtx_callbacks,skeleton,tep_termination,\
timer,vhost,vhost_scsi,vmdq,vmdq_dcb
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
2017-09-12 15:42:02 +00:00
|
|
|
endif
|
|
|
|
|
2019-05-17 12:02:30 +00:00
|
|
|
# list of all example apps. Keep 1-3 per line, in alphabetical order.
|
|
|
|
all_examples = [
|
2021-04-20 10:22:22 +00:00
|
|
|
'bbdev_app',
|
|
|
|
'bond',
|
|
|
|
'cmdline',
|
|
|
|
'distributor',
|
2021-10-26 13:14:32 +00:00
|
|
|
'dma',
|
2021-04-20 10:22:22 +00:00
|
|
|
'ethtool',
|
|
|
|
'eventdev_pipeline',
|
|
|
|
'fips_validation',
|
|
|
|
'flow_classify',
|
|
|
|
'flow_filtering',
|
|
|
|
'helloworld',
|
|
|
|
'ip_fragmentation',
|
|
|
|
'ip_pipeline',
|
|
|
|
'ip_reassembly',
|
|
|
|
'ipsec-secgw',
|
|
|
|
'ipv4_multicast',
|
|
|
|
'kni',
|
|
|
|
'l2fwd',
|
|
|
|
'l2fwd-cat',
|
|
|
|
'l2fwd-crypto',
|
|
|
|
'l2fwd-event',
|
|
|
|
'l2fwd-jobstats',
|
|
|
|
'l2fwd-keepalive',
|
|
|
|
'l3fwd',
|
|
|
|
'l3fwd-acl',
|
|
|
|
'l3fwd-graph',
|
|
|
|
'l3fwd-power',
|
|
|
|
'link_status_interrupt',
|
|
|
|
'multi_process/client_server_mp/mp_client',
|
|
|
|
'multi_process/client_server_mp/mp_server',
|
|
|
|
'multi_process/hotplug_mp',
|
|
|
|
'multi_process/simple_mp',
|
|
|
|
'multi_process/symmetric_mp',
|
|
|
|
'ntb',
|
|
|
|
'packet_ordering',
|
|
|
|
'pipeline',
|
|
|
|
'ptpclient',
|
|
|
|
'qos_meter',
|
|
|
|
'qos_sched',
|
|
|
|
'rxtx_callbacks',
|
|
|
|
'server_node_efd/node',
|
|
|
|
'server_node_efd/server',
|
|
|
|
'service_cores',
|
|
|
|
'skeleton',
|
|
|
|
'timer',
|
|
|
|
'vdpa',
|
|
|
|
'vhost',
|
|
|
|
'vhost_blk',
|
|
|
|
'vhost_crypto',
|
|
|
|
'vm_power_manager',
|
|
|
|
'vm_power_manager/guest_cli',
|
|
|
|
'vmdq',
|
|
|
|
'vmdq_dcb',
|
2019-05-17 12:02:30 +00:00
|
|
|
]
|
2018-03-29 13:54:34 +00:00
|
|
|
|
2021-03-12 14:56:05 +00:00
|
|
|
# on install, skip copying all meson.build files
|
|
|
|
ex_file_excludes = ['meson.build']
|
|
|
|
foreach ex:all_examples
|
2021-04-20 10:22:22 +00:00
|
|
|
ex_file_excludes += [ex + '/meson.build']
|
2021-03-12 14:56:05 +00:00
|
|
|
endforeach
|
|
|
|
|
2019-05-17 12:02:29 +00:00
|
|
|
if get_option('examples') == ''
|
2021-04-20 10:22:22 +00:00
|
|
|
subdir_done()
|
2019-05-17 12:02:29 +00:00
|
|
|
endif
|
|
|
|
|
2018-03-29 13:54:34 +00:00
|
|
|
if get_option('examples').to_lower() == 'all'
|
2021-04-20 10:22:22 +00:00
|
|
|
examples = all_examples
|
|
|
|
allow_skips = true # don't flag an error if we can't build an app
|
2018-03-29 13:54:34 +00:00
|
|
|
else
|
2021-04-20 10:22:22 +00:00
|
|
|
examples = get_option('examples').split(',')
|
|
|
|
allow_skips = false # error out if we can't build a requested app
|
2018-03-29 13:54:34 +00:00
|
|
|
endif
|
2018-07-19 14:22:06 +00:00
|
|
|
default_cflags = machine_args
|
|
|
|
if cc.has_argument('-Wno-format-truncation')
|
2021-04-20 10:22:22 +00:00
|
|
|
default_cflags += '-Wno-format-truncation'
|
2018-07-19 14:22:06 +00:00
|
|
|
endif
|
2020-12-18 13:14:22 +00:00
|
|
|
default_ldflags = dpdk_extra_ldflags
|
2021-01-12 00:36:02 +00:00
|
|
|
if get_option('default_library') == 'static' and not is_windows
|
2021-04-20 10:22:22 +00:00
|
|
|
default_ldflags += ['-Wl,--export-dynamic']
|
2020-12-18 13:14:22 +00:00
|
|
|
endif
|
2018-10-04 10:20:33 +00:00
|
|
|
|
2018-03-29 13:54:34 +00:00
|
|
|
foreach example: examples
|
2021-04-20 10:22:22 +00:00
|
|
|
name = example.split('/')[-1]
|
|
|
|
build = true
|
|
|
|
sources = []
|
|
|
|
allow_experimental_apis = false
|
|
|
|
cflags = default_cflags
|
|
|
|
ldflags = default_ldflags
|
2018-06-29 17:27:37 +00:00
|
|
|
|
2021-04-20 10:22:22 +00:00
|
|
|
ext_deps = []
|
|
|
|
includes = [include_directories(example)]
|
|
|
|
deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
|
|
|
|
subdir(example)
|
examples: build some samples with meson
Add support for having selected example apps built as part of a meson,
ninja build. By default none are built, and those to be built should be
named directly in the -Dexamples='' meson configuration argument.
This is useful for developers working on a feature who want to use a
suitable example, or examples, to test that feature, as they can compile
everything up in one go, and run the example without having to do a ninja
install first.
This commit adds examples which don't consist of multiple apps in
subdirectories to the meson build, so they can be built by default by
passing -Dexamples parameter to meson.
Not included are the following examples:
* ethtool
* multi-process
* netmap_compat
* performance-thread
* quota_watermark
* server_node_efd
* vm_power_manager
To test the apps added here, use the following command, merged to one line,
to add them to your meson build (command to be run inside the build
directory):
meson configure -Dexamples=bbdev_app,bond,cmdline,distributor,\
eventdev_pipeline_sw_pmd, exception_path,helloworld,\
ip_fragmentation,ip_pipeline,ip_reassembly, ipsec-secgw,\
ipv4_multicast,kni,l2fwd-cat,l2fwd-crypto,l2fwd-jobstats,\
l2fwd-keepalive,l2fwd,l3fwd-acl,l3fwd-power,l3fwd-vf,l3fwd,\
link_status_interrupt,load_balancer,packet_ordering,ptpclient,\
qos_meter,qos_sched,rxtx_callbacks,skeleton,tep_termination,\
timer,vhost,vhost_scsi,vmdq,vmdq_dcb
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
2017-09-12 15:42:02 +00:00
|
|
|
|
2021-11-06 08:53:04 +00:00
|
|
|
if build
|
|
|
|
dep_objs = ext_deps
|
|
|
|
foreach d:deps
|
|
|
|
var_name = get_option('default_library') + '_rte_' + d
|
|
|
|
if not is_variable(var_name)
|
|
|
|
build = false
|
|
|
|
message('Missing dependency "@0@" for example "@1@"'.format(d, name))
|
|
|
|
break
|
|
|
|
endif
|
|
|
|
dep_objs += [get_variable(var_name)]
|
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
|
2021-04-20 10:22:22 +00:00
|
|
|
if not build
|
|
|
|
if not allow_skips
|
|
|
|
error('Cannot build requested example "' + name + '"')
|
|
|
|
endif
|
|
|
|
message('Skipping example "' + name + '"')
|
|
|
|
continue
|
|
|
|
endif
|
|
|
|
|
|
|
|
if allow_experimental_apis
|
|
|
|
cflags += '-DALLOW_EXPERIMENTAL_API'
|
|
|
|
endif
|
|
|
|
executable('dpdk-' + name, sources,
|
|
|
|
include_directories: includes,
|
|
|
|
link_whole: link_whole_libs,
|
|
|
|
link_args: ldflags,
|
|
|
|
c_args: cflags,
|
|
|
|
dependencies: dep_objs)
|
examples: build some samples with meson
Add support for having selected example apps built as part of a meson,
ninja build. By default none are built, and those to be built should be
named directly in the -Dexamples='' meson configuration argument.
This is useful for developers working on a feature who want to use a
suitable example, or examples, to test that feature, as they can compile
everything up in one go, and run the example without having to do a ninja
install first.
This commit adds examples which don't consist of multiple apps in
subdirectories to the meson build, so they can be built by default by
passing -Dexamples parameter to meson.
Not included are the following examples:
* ethtool
* multi-process
* netmap_compat
* performance-thread
* quota_watermark
* server_node_efd
* vm_power_manager
To test the apps added here, use the following command, merged to one line,
to add them to your meson build (command to be run inside the build
directory):
meson configure -Dexamples=bbdev_app,bond,cmdline,distributor,\
eventdev_pipeline_sw_pmd, exception_path,helloworld,\
ip_fragmentation,ip_pipeline,ip_reassembly, ipsec-secgw,\
ipv4_multicast,kni,l2fwd-cat,l2fwd-crypto,l2fwd-jobstats,\
l2fwd-keepalive,l2fwd,l3fwd-acl,l3fwd-power,l3fwd-vf,l3fwd,\
link_status_interrupt,load_balancer,packet_ordering,ptpclient,\
qos_meter,qos_sched,rxtx_callbacks,skeleton,tep_termination,\
timer,vhost,vhost_scsi,vmdq,vmdq_dcb
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
2017-09-12 15:42:02 +00:00
|
|
|
endforeach
|