From eb5eb7aea7fc41a2c15d853cd57c7c030644f4ee Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 19 Jun 2019 15:31:32 +0200 Subject: build: Make threads dependency more explicit --- meson.build | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'meson.build') 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') -- cgit v1.1