Commit 74182eb6 authored by Loïc Yhuel's avatar Loïc Yhuel
Browse files

meson: link with -lrt if needed for clock_gettime



This is already done in autotools, and fixes the build with glibc < 2.17.
Signed-off-by: Loïc Yhuel's avatarLoïc Yhuel <loic.yhuel@softathome.com>
parent ea09c2fd
Pipeline #248908 passed with stages
in 1 minute and 27 seconds
......@@ -56,6 +56,14 @@ if get_option('libraries')
error('@0@ is needed to compile Wayland libraries'.format(d['symbol']))
endif
endforeach
rt_dep = []
if not cc.has_function('clock_gettime', prefix: '#include <time.h>')
rt_dep = cc.find_library('rt')
if not cc.has_function('clock_gettime', prefix: '#include <time.h>', dependencies: rt_dep)
error('clock_gettime not found')
endif
endif
endif
scanner_deps = [ dependency('expat') ]
......
......@@ -77,7 +77,7 @@ if get_option('libraries')
'connection.c',
'wayland-os.c'
],
dependencies: [ ffi_dep, ]
dependencies: [ ffi_dep, rt_dep ]
)
wayland_private_dep = declare_dependency(
......@@ -155,7 +155,8 @@ if get_option('libraries')
wayland_private_dep,
wayland_util_dep,
mathlib_dep,
threads_dep
threads_dep,
rt_dep
],
include_directories: root_inc,
install: true
......
......@@ -54,7 +54,7 @@ benchmark(
executable(
'fixed-benchmark',
'fixed-benchmark.c',
dependencies: test_runner_dep
dependencies: [ test_runner_dep, rt_dep ]
)
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment