meson: Move shm_dep check where it belongs

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
This commit is contained in:
Arnaud Rebillout 2018-10-31 12:36:01 +07:00 committed by Arun Raghavan
parent a9b55dbbd4
commit f6abc6841e

View file

@ -205,11 +205,6 @@ foreach f : check_functions
endif endif
endforeach endforeach
shm_dep = cc.find_library('rt', required : false)
if shm_dep.found()
cdata.set('HAVE_SHM_OPEN', 1)
endif
if cc.has_function('SYS_memfd_create', prefix : '#include <sys/syscall.h>') if cc.has_function('SYS_memfd_create', prefix : '#include <sys/syscall.h>')
cdata.set('HAVE_MEMFD', 1) cdata.set('HAVE_MEMFD', 1)
endif endif
@ -249,6 +244,11 @@ libm_dep = cc.find_library('m', required : true)
thread_dep = dependency('threads') thread_dep = dependency('threads')
cap_dep = cc.find_library('cap', required : false) cap_dep = cc.find_library('cap', required : false)
shm_dep = cc.find_library('rt', required : false)
if shm_dep.found()
cdata.set('HAVE_SHM_OPEN', 1)
endif
atomictest = '''void func() { atomictest = '''void func() {
volatile int atomic = 2; volatile int atomic = 2;
__sync_bool_compare_and_swap (&atomic, 2, 3); __sync_bool_compare_and_swap (&atomic, 2, 3);