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:
authorJan Beich <jbeich@FreeBSD.org>2019-07-29 21:37:33 +0300
committerJean-Baptiste Kempf <jb@videolan.org>2019-11-24 11:24:42 +0300
commita52459b3e5a924f9a79e9b76998dd9a87a52b79a (patch)
tree06c89c6231861440daf47c291eaa3d4f17cb6161 /meson.build
parentcf4b381ac772978b3179657475b9fdfb8b17c629 (diff)
checkasm: replace gettimeofday with clock_gettime
tests/checkasm/checkasm.c:55:5: warning: implicit declaration of function 'gettimeofday' is invalid in C99 [-Wimplicit-function-declaration] gettimeofday(&tv, NULL); ^
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build14
1 files changed, 13 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index de7cd49..034eae5 100644
--- a/meson.build
+++ b/meson.build
@@ -113,11 +113,23 @@ if host_machine.system() == 'windows'
# On Windows, we use a compatibility layer to emulate pthread
thread_dependency = []
thread_compat_dep = declare_dependency(sources : files('src/win32/thread.c'))
+
+ rt_dependency = []
else
thread_dependency = dependency('threads')
thread_compat_dep = []
-endif
+ rt_dependency = []
+ if cc.has_function('clock_gettime', prefix : '#include <time.h>', args : test_args)
+ cdata.set('HAVE_CLOCK_GETTIME', 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
+ cdata.set('HAVE_CLOCK_GETTIME', 1)
+ endif
+endif
# Header checks