summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorJordan Williams <jordan@jwillikers.com>2022-10-06 08:56:36 -0500
committerJordan Williams <jordan@jwillikers.com>2022-10-06 13:22:06 -0500
commitb20b379e502c02d49f62fc25f8dbcc36cfe95ab2 (patch)
tree0715284baba254714b9e3539d74a63c75136f9d3 /meson.build
parent71cac05ffb346f90ce4145840a22ceeae5a0f5ab (diff)
downloaddbus-b20b379e502c02d49f62fc25f8dbcc36cfe95ab2.tar.gz
Check for more symbols before defining HAVE_CLOCK_MONOTONIC in Meson
MacOS has limited support for monotonic clock in its pthread implementation. When building with Meson, `HAVE_MONOTONIC_CLOCK` is defined despite this. This PR checks for the existence of the missing function `pthread_condattr_setclock`. To match parity with AutoTools, it also checks for `clock_getres`. Fixes #419.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build4
1 files changed, 3 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 3b5b182c..20e9dbc6 100644
--- a/meson.build
+++ b/meson.build
@@ -328,7 +328,9 @@ data_config.set('top_builddir', meson.project_build_root())
threads = dependency('threads')
config.set(
'HAVE_MONOTONIC_CLOCK',
- cc.has_header_symbol('pthread.h', 'CLOCK_MONOTONIC', args: compile_args_c),
+ cc.has_header_symbol('pthread.h', 'CLOCK_MONOTONIC', args: compile_args_c)
+ and cc.has_header_symbol('pthread.h', 'pthread_condattr_setclock', args: compile_args_c)
+ and cc.has_header_symbol('time.h', 'clock_getres', args: compile_args_c),
)
glib = dependency(