DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] build: factorize jansson availability check
@ 2021-11-08 10:08 David Marchand
  2021-11-10 15:38 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: David Marchand @ 2021-11-08 10:08 UTC (permalink / raw)
  To: dev; +Cc: thomas, Xiaoyun Li, Bruce Richardson

Since two components wants to know if the jansson library is available,
move it to config/.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test-pmd/meson.build | 9 ++++-----
 config/meson.build       | 5 +++++
 lib/metrics/meson.build  | 6 ++----
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
index b05c531c7f..d5df52c470 100644
--- a/app/test-pmd/meson.build
+++ b/app/test-pmd/meson.build
@@ -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
diff --git a/config/meson.build b/config/meson.build
index 17b5bec406..f7e2b2f331 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -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'
diff --git a/lib/metrics/meson.build b/lib/metrics/meson.build
index 3cb43d9ee7..8c1c4b4b49 100644
--- a/lib/metrics/meson.build
+++ b/lib/metrics/meson.build
@@ -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']
-- 
2.23.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-10 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 10:08 [dpdk-dev] [PATCH] build: factorize jansson availability check David Marchand
2021-11-10 15:38 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).