DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2 2/3] meson: use threads dependency as provided by meson
@ 2021-03-22 14:07 Gabriel Ganne
  2021-03-22 14:07 ` [dpdk-dev] [PATCH v2 3/3] meson: remove unnecessary explicit link to libpcap Gabriel Ganne
  2021-03-22 16:04 ` [dpdk-dev] [PATCH v2 2/3] meson: use threads dependency as provided by meson Nick Connolly
  0 siblings, 2 replies; 15+ messages in thread
From: Gabriel Ganne @ 2021-03-22 14:07 UTC (permalink / raw)
  To: Bruce Richardson, Kevin Laatz
  Cc: dev, olivier.matz, thierry.herbelot, Gabriel Ganne

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


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

end of thread, other threads:[~2023-07-16 17:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 14:07 [dpdk-dev] [PATCH v2 2/3] meson: use threads dependency as provided by meson Gabriel Ganne
2021-03-22 14:07 ` [dpdk-dev] [PATCH v2 3/3] meson: remove unnecessary explicit link to libpcap Gabriel Ganne
2021-04-09  8:39   ` [dpdk-dev] [PATCH v4] " Gabriel Ganne
2021-04-09 12:25     ` [dpdk-dev] [PATCH v5] build: remove redundant libpcap link Thomas Monjalon
2021-04-14  9:41       ` Thomas Monjalon
2021-04-14 21:02         ` Dmitry Kozlyuk
2021-04-14 21:10           ` Thomas Monjalon
2023-07-16 17:19             ` Stephen Hemminger
2023-07-16 17:21     ` [dpdk-dev] [PATCH v4] meson: remove unnecessary explicit link to libpcap Stephen Hemminger
2021-03-22 16:04 ` [dpdk-dev] [PATCH v2 2/3] meson: use threads dependency as provided by meson Nick Connolly
2021-03-22 22:18   ` Dmitry Kozlyuk
2021-03-23 13:35     ` Nick Connolly
2021-03-23 21:21       ` Dmitry Kozlyuk
2021-03-23 22:17         ` Nick Connolly
2021-03-24  6:35           ` Gabriel Ganne

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).