Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Grunau <janne-vlc@jannau.net>2019-06-16 14:10:12 +0300
committerJanne Grunau <janne-vlc@jannau.net>2019-06-19 09:31:20 +0300
commit79e4a5f7c126b7b655f3bb0c4bd4a537705e37b3 (patch)
tree529381c9f75937fd31e849b284cf7d0a4252cd57 /tools/meson.build
parenta1e3f35842de92b526422af05360c84cf233f07f (diff)
cli: use mach_absolute_time as fallback for clock_gettime on darwin. Fixes #283
clock_gettime() is only available since MacOS X 10.12 (Sierra).
Diffstat (limited to 'tools/meson.build')
-rw-r--r--tools/meson.build14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/meson.build b/tools/meson.build
index 9f9356d..5b942b3 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -31,16 +31,26 @@ if not get_option('build_tools')
subdir_done()
endif
+
+# Configuratin data for cli_config.h
+cli_cdata = configuration_data()
+
rt_dependency = []
if host_machine.system() != 'windows'
- if not cc.has_function('clock_gettime', prefix : '#include <time.h>', args : test_args)
+ if cc.has_function('clock_gettime', prefix : '#include <time.h>', args : test_args)
+ cli_cdata.set('HAVE_CLOCK_GETTIME', 1)
+ elif host_machine.system() == 'darwin'
+ cli_cdata.set('HAVE_MACH_ABSOLUTE_TIME', 1)
+ else
rt_dependency = cc.find_library('rt', required: false)
if not cc.has_function('clock_gettime', prefix : '#include <time.h>', args : test_args, dependencies : rt_dependency)
error('clock_gettime not found')
endif
+ cli_cdata.set('HAVE_CLOCK_GETTIME', 1)
endif
endif
+cli_config_h_target = configure_file(output: 'cli_config.h', configuration: cli_cdata)
# dav1d cli tool sources
dav1d_sources = files(
@@ -58,7 +68,7 @@ dav1d_sources = files(
dav1d = executable('dav1d',
dav1d_sources,
- rev_target,
+ rev_target, cli_config_h_target,
link_with : libdav1d,
include_directories : [dav1d_inc_dirs],