DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gabriel Ganne <gabriel.ganne@6wind.com>
To: Bruce Richardson <bruce.richardson@intel.com>,
	Kevin Laatz <kevin.laatz@intel.com>
Cc: dev@dpdk.org, olivier.matz@6wind.com, thierry.herbelot@6wind.com,
	Gabriel Ganne <gabriel.ganne@6wind.com>
Subject: [dpdk-dev] [PATCH 2/3] meson: use threads dependency as provided by meson
Date: Mon, 22 Mar 2021 09:39:00 +0100	[thread overview]
Message-ID: <20210322083901.22493-2-gabriel.ganne@6wind.com> (raw)
In-Reply-To: <20210322083901.22493-1-gabriel.ganne@6wind.com>

meson guarantees this is portable, so this also allows us to remove a
is_windows switch.

Link: https://mesonbuild.com/howtox.html#enable-threads
Signed-off-by: Gabriel Ganne <gabriel.ganne@6wind.com>
---
 config/meson.build               | 5 +----
 lib/librte_metrics/meson.build   | 2 ++
 lib/librte_telemetry/meson.build | 2 ++
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 3cf560b8a3f5..0fb7e1b27a0f 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -113,10 +113,7 @@ if not is_windows
 endif
 
 # use pthreads if available for the platform
-if not is_windows
-	add_project_link_arguments('-pthread', language: 'c')
-	dpdk_extra_ldflags += '-pthread'
-endif
+threads_dep = dependency('threads')
 
 # on some OS, maths functions are in a separate library
 if cc.find_library('m', required : false).found()
diff --git a/lib/librte_metrics/meson.build b/lib/librte_metrics/meson.build
index d5be6a214530..29d922eded53 100644
--- a/lib/librte_metrics/meson.build
+++ b/lib/librte_metrics/meson.build
@@ -4,6 +4,8 @@
 sources = files('rte_metrics.c', 'rte_metrics_telemetry.c')
 headers = files('rte_metrics.h', 'rte_metrics_telemetry.h')
 
+ext_deps += threads_dep
+
 jansson = dependency('jansson', required: false, method: 'pkg-config')
 if jansson.found()
 	dpdk_conf.set('RTE_HAS_JANSSON', 1)
diff --git a/lib/librte_telemetry/meson.build b/lib/librte_telemetry/meson.build
index 719973ff9240..46ac9829e54b 100644
--- a/lib/librte_telemetry/meson.build
+++ b/lib/librte_telemetry/meson.build
@@ -3,6 +3,8 @@
 
 includes = [global_inc]
 
+ext_deps += threads_dep
+
 sources = files('telemetry.c', 'telemetry_data.c', 'telemetry_legacy.c')
 headers = files('rte_telemetry.h')
 includes += include_directories('../librte_metrics')
-- 
2.29.2


  reply	other threads:[~2021-03-22  8:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22  8:38 [dpdk-dev] [PATCH 1/3] meson: fix minimum required meson version Gabriel Ganne
2021-03-22  8:39 ` Gabriel Ganne [this message]
2021-03-22  8:39 ` [dpdk-dev] [PATCH 3/3] meson: remove unnecessary explicit link to libpcap Gabriel Ganne
2021-03-22  9:34 ` [dpdk-dev] [PATCH 1/3] meson: fix minimum required meson version Bruce Richardson
2021-03-22 15:25   ` Dmitry Kozlyuk
2021-03-23  6:22     ` Gabriel Ganne
2021-03-23  7:16       ` Andrew Rybchenko
2021-03-23  7:42       ` Dmitry Kozlyuk
2021-03-23  9:38       ` Bruce Richardson
2021-04-01 11:09         ` Bruce Richardson
2021-03-22 13:57 ` David Marchand

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=20210322083901.22493-2-gabriel.ganne@6wind.com \
    --to=gabriel.ganne@6wind.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=kevin.laatz@intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=thierry.herbelot@6wind.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).