hc
2024-11-01 a01b5c9f91adaee088a817861603a5dbe14775c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 96bbf3a3af45d86f790afdf91a6686c37421e92b Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sun, 15 Nov 2020 10:57:37 +0100
Subject: [PATCH] meson.build: check for pthread.h
 
Check for pthread.h otherwise the build will fail with some toolchains
that have libphtread.so but not pthread.h:
 
Run-time dependency threads found: YES
 
../src/hb-mutex.hh:53:10: fatal error: pthread.h: No such file or directory
 #include <pthread.h>
          ^~~~~~~~~~~
 
Moreover, fix detection of pthread fallback
 
Fixes:
 - http://autobuild.buildroot.org/results/70c98e89b1d5e5b651d1f6928dc53f465103f57a
 
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 meson.build | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
 
diff --git a/meson.build b/meson.build
index bf3925db..6d263d48 100644
--- a/meson.build
+++ b/meson.build
@@ -281,7 +281,9 @@ endif
 # threads
 thread_dep = null_dep
 if host_machine.system() != 'windows'
-  thread_dep = dependency('threads', required: false)
+  if cpp.has_header('pthread.h')
+    thread_dep = dependency('threads', required: false)
+  endif
 
   if thread_dep.found()
     conf.set('HAVE_PTHREAD', 1)
-- 
2.29.2