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
|
|
|
|
|
|
|
driver_libs = []
|
2020-04-11 14:14:24 +00:00
|
|
|
node_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'
|
|
|
|
driver_libs = dpdk_drivers
|
2020-04-11 14:14:24 +00:00
|
|
|
node_libs = dpdk_graph_nodes
|
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
|
|
|
|
|
2018-02-01 14:20:08 +00:00
|
|
|
execinfo = cc.find_library('execinfo', required: false)
|
2018-03-29 13:54:34 +00:00
|
|
|
|
2019-05-17 12:02:30 +00:00
|
|
|
# list of all example apps. Keep 1-3 per line, in alphabetical order.
|
|
|
|
all_examples = [
|
|
|
|
'bbdev_app', 'bond',
|
2019-10-22 15:43:02 +00:00
|
|
|
'cmdline',
|
2019-05-17 12:02:30 +00:00
|
|
|
'distributor', 'ethtool',
|
2019-10-25 09:56:04 +00:00
|
|
|
'eventdev_pipeline',
|
2019-05-17 12:02:30 +00:00
|
|
|
'fips_validation', 'flow_classify',
|
|
|
|
'flow_filtering', 'helloworld',
|
2019-10-07 11:08:04 +00:00
|
|
|
'ioat',
|
2019-05-17 12:02:30 +00:00
|
|
|
'ip_fragmentation', 'ip_pipeline',
|
|
|
|
'ip_reassembly', 'ipsec-secgw',
|
|
|
|
'ipv4_multicast', 'kni',
|
2019-10-30 16:26:42 +00:00
|
|
|
'l2fwd', 'l2fwd-cat', 'l2fwd-event',
|
2019-05-17 12:02:30 +00:00
|
|
|
'l2fwd-crypto', 'l2fwd-jobstats',
|
|
|
|
'l2fwd-keepalive', 'l3fwd',
|
2020-04-11 14:14:24 +00:00
|
|
|
'l3fwd-acl', 'l3fwd-power', 'l3fwd-graph',
|
2019-10-25 09:56:05 +00:00
|
|
|
'link_status_interrupt',
|
2019-05-23 17:40:39 +00:00
|
|
|
'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',
|
2019-10-25 09:56:07 +00:00
|
|
|
'ntb', 'packet_ordering',
|
2019-10-22 15:43:05 +00:00
|
|
|
'performance-thread/l3fwd-thread',
|
2019-10-22 15:43:06 +00:00
|
|
|
'performance-thread/pthread_shim',
|
2019-10-22 15:43:05 +00:00
|
|
|
'ptpclient',
|
2019-05-17 12:02:30 +00:00
|
|
|
'qos_meter', 'qos_sched',
|
2019-10-25 09:56:06 +00:00
|
|
|
'rxtx_callbacks',
|
2019-10-22 15:43:07 +00:00
|
|
|
'server_node_efd/node',
|
2019-10-22 15:43:08 +00:00
|
|
|
'server_node_efd/server',
|
2019-10-22 15:43:07 +00:00
|
|
|
'service_cores',
|
2019-05-17 12:02:30 +00:00
|
|
|
'skeleton', 'tep_termination',
|
|
|
|
'timer', 'vdpa',
|
|
|
|
'vhost', 'vhost_crypto',
|
2019-11-04 16:36:26 +00:00
|
|
|
'vhost_blk', 'vm_power_manager',
|
2019-10-22 15:43:10 +00:00
|
|
|
'vm_power_manager/guest_cli',
|
2019-05-17 12:02:30 +00:00
|
|
|
'vmdq', 'vmdq_dcb',
|
|
|
|
]
|
2019-05-02 16:51:52 +00:00
|
|
|
# install all example code on install - irrespective of whether the example in
|
|
|
|
# question is to be built as part of this build or not.
|
|
|
|
foreach ex:all_examples
|
|
|
|
install_subdir(ex,
|
|
|
|
install_dir: get_option('datadir') + '/dpdk/examples',
|
|
|
|
exclude_files: 'meson.build')
|
|
|
|
endforeach
|
2018-03-29 13:54:34 +00:00
|
|
|
|
2019-05-17 12:02:29 +00:00
|
|
|
if get_option('examples') == ''
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2018-03-29 13:54:34 +00:00
|
|
|
if get_option('examples').to_lower() == 'all'
|
2019-05-02 16:51:52 +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
|
|
|
|
examples = get_option('examples').split(',')
|
|
|
|
allow_skips = false # error out if we can't build a requested app
|
|
|
|
endif
|
2018-07-19 14:22:06 +00:00
|
|
|
default_cflags = machine_args
|
|
|
|
if cc.has_argument('-Wno-format-truncation')
|
|
|
|
default_cflags += '-Wno-format-truncation'
|
|
|
|
endif
|
2018-10-04 10:20:33 +00:00
|
|
|
|
2018-03-29 13:54:34 +00:00
|
|
|
foreach example: examples
|
2019-05-23 17:40:38 +00:00
|
|
|
name = example.split('/')[-1]
|
2018-03-29 13:54:34 +00:00
|
|
|
build = true
|
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
|
|
|
sources = []
|
|
|
|
allow_experimental_apis = false
|
2018-07-19 14:22:06 +00:00
|
|
|
cflags = default_cflags
|
2018-06-29 17:27:37 +00:00
|
|
|
|
2018-02-01 14:20:08 +00:00
|
|
|
ext_deps = [execinfo]
|
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
|
|
|
includes = [include_directories(example)]
|
|
|
|
deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
|
2019-04-09 10:55:36 +00:00
|
|
|
if is_windows
|
2019-04-02 03:54:58 +00:00
|
|
|
deps = ['eal'] # only supported lib on Windows currently
|
|
|
|
endif
|
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
|
|
|
subdir(example)
|
|
|
|
|
2018-03-29 13:54:34 +00:00
|
|
|
if build
|
|
|
|
dep_objs = ext_deps
|
|
|
|
foreach d:deps
|
2018-03-29 13:54:35 +00:00
|
|
|
var_name = get_option('default_library') + '_rte_' + d
|
|
|
|
if not is_variable(var_name)
|
|
|
|
error('Missing dependency "@0@" for example "@1@"'.format(d, name))
|
|
|
|
endif
|
|
|
|
dep_objs += [get_variable(var_name)]
|
2018-03-29 13:54:34 +00:00
|
|
|
endforeach
|
|
|
|
if allow_experimental_apis
|
|
|
|
cflags += '-DALLOW_EXPERIMENTAL_API'
|
|
|
|
endif
|
|
|
|
executable('dpdk-' + name, sources,
|
|
|
|
include_directories: includes,
|
2020-04-11 14:14:24 +00:00
|
|
|
link_whole: driver_libs + node_libs,
|
2018-03-29 13:54:34 +00:00
|
|
|
link_args: dpdk_extra_ldflags,
|
|
|
|
c_args: cflags,
|
|
|
|
dependencies: dep_objs)
|
|
|
|
elif not allow_skips
|
|
|
|
error('Cannot build requested example "' + name + '"')
|
|
|
|
else
|
|
|
|
message('Skipping example "' + name + '"')
|
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
|
|
|
|
endforeach
|