2017-12-18 15:56:25 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright(c) 2017 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 = []
|
|
|
|
if get_option('default_library') == 'static'
|
|
|
|
driver_libs = dpdk_drivers
|
|
|
|
endif
|
|
|
|
|
2018-02-01 14:20:08 +00:00
|
|
|
execinfo = cc.find_library('execinfo', required: false)
|
2018-03-29 13:54:34 +00:00
|
|
|
|
|
|
|
allow_skips = true # don't flag an error if we can't build an app
|
|
|
|
|
|
|
|
if get_option('examples').to_lower() == 'all'
|
|
|
|
dirs = run_command('sh', '-c',
|
|
|
|
'cd $MESON_SOURCE_ROOT/$MESON_SUBDIR && for d in * ; do if [ -d $d ] ; then echo $d ; fi ; done')
|
|
|
|
examples = dirs.stdout().split()
|
|
|
|
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
|
|
|
|
|
|
|
# specify -D_GNU_SOURCE unconditionally
|
|
|
|
default_cflags += '-D_GNU_SOURCE'
|
|
|
|
|
2018-03-29 13:54:34 +00:00
|
|
|
foreach example: examples
|
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
|
|
|
name = example
|
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']
|
|
|
|
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,
|
|
|
|
link_whole: driver_libs,
|
|
|
|
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
|