summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Gilbert <bgilbert@backtick.net>2023-09-23 00:57:14 -0500
committerMatt Turner <mattst88@gmail.com>2023-11-08 18:43:10 +0000
commitb4b789df5b39cecdb598b35a3aa2ca9637029564 (patch)
treec6b1728ced878c4c92cba5940f6e2a2acea99836
parent08115a4217e0cb783ab391c2d98edcc3f14d51b6 (diff)
meson: avoid linking with -pthread if we don't have pthreads
Meson always returns -pthread in dependency('threads') on non-MSVC compilers. Fix a link error when building on MinGW without winpthreads.
-rw-r--r--meson.build3
1 files changed, 3 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index f822fb5..5c896ac 100644
--- a/meson.build
+++ b/meson.build
@@ -485,6 +485,9 @@ if dep_threads.found() and cc.has_header('pthread.h')
else
pthreads_found = true
endif
+else
+ # Avoid linking with -pthread if we don't actually have pthreads
+ dep_threads = null_dep
endif
if pthreads_found