build: factorize jansson availability check
PATCH 1/1 build: factorize jansson availability check
Since two components wants to know if the jansson library is available, move it to config/.
Signed-off-by David Marchand <[email protected]>
--- app/test-pmd/meson.build | 9 ++++----- config/meson.build | 5 +++++ lib/metrics/meson.build | 6 ++---- 3 files changed, 11 insertions(+), 9 deletions(-)
app/test-pmd/meson.build +4 -5
@@ -28,6 +28,10 @@ sources = files( 'util.c', ) +if dpdk_conf.has('RTE_HAS_JANSSON') + ext_deps += jansson_dep +endif + deps += ['ethdev', 'gro', 'gso', 'cmdline', 'metrics', 'bus_pci'] if dpdk_conf.has('RTE_CRYPTO_SCHEDULER') deps += 'crypto_scheduler'
@@ -60,8 +64,3 @@ endif if dpdk_conf.has('RTE_NET_DPAA') deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa'] endif -jansson_dep = dependency('jansson', required: false, method: 'pkg-config') -if jansson_dep.found() - dpdk_conf.set('RTE_HAS_JANSSON', 1) - ext_deps += jansson_dep -endif
config/meson.build +5 -0
@@ -218,6 +218,11 @@ if libbsd.found() dpdk_conf.set('RTE_USE_LIBBSD', 1) endif +jansson_dep = dependency('jansson', required: false, method: 'pkg-config') +if jansson_dep.found() + dpdk_conf.set('RTE_HAS_JANSSON', 1) +endif + # check for pcap pcap_dep = dependency('libpcap', required: false, method: 'pkg-config') pcap_lib = is_windows ? 'wpcap' : 'pcap'
lib/metrics/meson.build +2 -4
@@ -4,10 +4,8 @@ sources = files('rte_metrics.c', 'rte_metrics_telemetry.c') headers = files('rte_metrics.h', 'rte_metrics_telemetry.h') -jansson = dependency('jansson', required: false, method: 'pkg-config') -if jansson.found() - dpdk_conf.set('RTE_HAS_JANSSON', 1) - ext_deps += jansson +if dpdk_conf.has('RTE_HAS_JANSSON') + ext_deps += jansson_dep endif deps += ['ethdev', 'telemetry']
Signature · 1 line
2.23.0
Thomas Monjalon
Applied08/11/2021 11:08, David Marchand:
Quoted 4 lines
Since two components wants to know if the jansson library is available, move it to config/.
Signed-off-by David Marchand <[email protected]>
Applied, thanks.