From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, Xiaoyun Li <xiaoyun.li@intel.com>,
Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH] build: factorize jansson availability check
Date: Mon, 8 Nov 2021 11:08:08 +0100 [thread overview]
Message-ID: <20211108100808.30795-1-david.marchand@redhat.com> (raw)
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
next reply other threads:[~2021-11-08 10:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 10:08 David Marchand [this message]
2021-11-10 15:38 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211108100808.30795-1-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
--cc=xiaoyun.li@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).