summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2019-06-19 15:31:32 +0200
committerDaiki Ueno <ueno@gnu.org>2019-06-19 15:59:01 +0200
commiteb5eb7aea7fc41a2c15d853cd57c7c030644f4ee (patch)
tree53e4c60054375bd5197749edeaa02fec374602e1 /meson.build
parentdaf1a84de39c4cdbd308c6a0b80b437689a222c7 (diff)
build: Make threads dependency more explicit
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build12
1 files changed, 4 insertions, 8 deletions
diff --git a/meson.build b/meson.build
index 77883e0..89f8421 100644
--- a/meson.build
+++ b/meson.build
@@ -75,19 +75,15 @@ tests_c_args = [
conf.set('SIZEOF_UNSIGNED_LONG', cc.sizeof('unsigned long'))
-pthread_create_deps = []
nanosleep_deps = []
dlopen_deps = []
socket_deps = []
+thread_deps = []
if host_system != 'windows'
- if not cc.has_function('pthread_create')
- libpthread = cc.find_library('pthread', required: false)
- if cc.has_function('pthread_create', dependencies: libpthread)
- pthread_create_deps += libpthread
- else
- error('could not find pthread_create')
- endif
+ thread_deps += dependency('threads')
+ if not cc.has_function('pthread_create', dependencies: thread_deps)
+ error('could not find pthread_create')
endif
if not cc.has_function('nanosleep')