Commit 5236de6c authored by Eric Engestrom's avatar Eric Engestrom 💤
Browse files

meson: use pkg-config to detect libatomic_ops


Signed-off-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov's avatarEmil Velikov <emil.velikov@collabora.com>
parent a5329cd9
......@@ -37,7 +37,7 @@ libdrm_amdgpu = shared_library(
],
include_directories : [inc_root, inc_drm],
link_with : libdrm,
dependencies : dep_pthread_stubs,
dependencies : [dep_pthread_stubs, dep_atomic_ops],
version : '1.0.0',
install : true,
)
......
......@@ -31,7 +31,7 @@ libdrm_etnaviv = shared_library(
include_directories : [inc_root, inc_drm],
link_with : libdrm,
c_args : warn_c_args,
dependencies : [dep_pthread_stubs, dep_rt],
dependencies : [dep_pthread_stubs, dep_rt, dep_atomic_ops],
version : '1.0.0',
install : true,
)
......
......@@ -44,7 +44,7 @@ libdrm_freedreno = shared_library(
[files_freedreno, config_file],
c_args : warn_c_args,
include_directories : [inc_root, inc_drm],
dependencies : [dep_valgrind, dep_pthread_stubs, dep_rt],
dependencies : [dep_valgrind, dep_pthread_stubs, dep_rt, dep_atomic_ops],
link_with : libdrm,
version : '1.0.0',
install : true,
......
......@@ -29,7 +29,7 @@ libdrm_intel = shared_library(
],
include_directories : [inc_root, inc_drm],
link_with : libdrm,
dependencies : [dep_pciaccess, dep_pthread_stubs, dep_rt, dep_valgrind],
dependencies : [dep_pciaccess, dep_pthread_stubs, dep_rt, dep_valgrind, dep_atomic_ops],
c_args : warn_c_args,
version : '1.0.0',
install : true,
......
......@@ -48,6 +48,7 @@ cc = meson.get_compiler('c')
intel_atomics = false
lib_atomics = false
dep_atomic_ops = dependency('atomic_ops', required : false)
if cc.compiles('''
int atomic_add(int *i) { return __sync_add_and_fetch (i, 1); }
int atomic_cmpxchg(int *i, int j, int k) { return __sync_val_compare_and_swap (i, j, k); }
......@@ -55,7 +56,8 @@ if cc.compiles('''
name : 'Intel Atomics')
intel_atomics = true
with_atomics = true
elif cc.has_header('atomic_ops.h')
dep_atomic_ops = []
elif dep_atomic_ops.found()
lib_atomics = true
with_atomics = true
elif cc.has_function('atomic_cas_uint')
......
......@@ -25,7 +25,7 @@ libdrm_nouveau = shared_library(
c_args : warn_c_args,
include_directories : [inc_root, inc_drm],
link_with : libdrm,
dependencies : dep_threads,
dependencies : [dep_threads, dep_atomic_ops],
version : '2.0.0',
install : true,
)
......
......@@ -24,7 +24,7 @@ libdrm_omap = shared_library(
include_directories : [inc_root, inc_drm],
c_args : warn_c_args,
link_with : libdrm,
dependencies : [dep_pthread_stubs],
dependencies : [dep_pthread_stubs, dep_atomic_ops],
version : '1.0.0',
install : true,
)
......
......@@ -31,7 +31,7 @@ libdrm_radeon = shared_library(
c_args : warn_c_args,
include_directories : [inc_root, inc_drm],
link_with : libdrm,
dependencies : [dep_pthread_stubs],
dependencies : [dep_pthread_stubs, dep_atomic_ops],
version : '1.0.1',
install : true,
)
......
......@@ -23,7 +23,7 @@ libdrm_tegra = shared_library(
[files('tegra.c'), config_file],
include_directories : [inc_root, inc_drm],
link_with : libdrm,
dependencies : [dep_pthread_stubs],
dependencies : [dep_pthread_stubs, dep_atomic_ops],
c_args : warn_c_args,
version : '0.0.0',
install : true,
......
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