summaryrefslogtreecommitdiff
blob: df68082cca6e0c34ca66b80e36b363b227dd4094 (plain)
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
https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/aad470dad519b6fe3459023b82941b4414b71313

From aad470dad519b6fe3459023b82941b4414b71313 Mon Sep 17 00:00:00 2001
From: Thomas Devoogdt <thomas@devoogdt.com>
Date: Sun, 26 Jan 2025 10:15:39 +0100
Subject: [PATCH] meson.build: explicitly check for pthread support

Tested using buildroot. The br-arm-full-nothread fails
because meson assumes thread support when cross-compiling.

Dependency threads found: YES unknown (cached)
Has header "pthread.h" : NO

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
---
 meson.build | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 85968b29..9e9993a2 100644
--- a/meson.build
+++ b/meson.build
@@ -383,8 +383,10 @@ endif
 
 if host_machine.system() != 'windows'
   thread_dep = dependency('threads')
-  conf.set('HAVE_PTHREAD', 1)
-  deps += [thread_dep]
+  if thread_dep.found() and cc.has_header('pthread.h')
+    conf.set('HAVE_PTHREAD', 1)
+    deps += [thread_dep]
+  endif
 endif
 
 fc_templatedir = get_option('template-dir')
-- 
GitLab