From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 47FEFA0C4B; Mon, 8 Nov 2021 11:08:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0FEF440151; Mon, 8 Nov 2021 11:08:56 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 1815D40040 for ; Mon, 8 Nov 2021 11:08:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636366133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VZka66n8CJZEkCwW3IG3aaW5SHhejZjj9a3h5rYyf0M=; b=JwH9b1rVGiRSyC/L43SDFPvQaP8ozOU+i6GYKJWkkME44P+16IqxG5yrVVuejSKNG/JLBd S+HcQ9tFqRY6OaClqwxV6gvimTNP2L/M8f0j+8D9n5mPI6vGqsY3J2vL08JG3C9aWbQpo8 rCWWxZ3LGLFqjYwxp3EmWsOxHqUY+QA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-587-bHmcQQP-O2K-ryYyyQxMbw-1; Mon, 08 Nov 2021 05:08:52 -0500 X-MC-Unique: bHmcQQP-O2K-ryYyyQxMbw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 59DAB1023F5F; Mon, 8 Nov 2021 10:08:51 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.194.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7714C60CA0; Mon, 8 Nov 2021 10:08:48 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, Xiaoyun Li , Bruce Richardson Date: Mon, 8 Nov 2021 11:08:08 +0100 Message-Id: <20211108100808.30795-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH] build: factorize jansson availability check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Since two components wants to know if the jansson library is available, move it to config/. Signed-off-by: David Marchand --- 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