aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Engestrom2018-02-07 08:20:52 -0600
committerEric Engestrom2018-03-09 11:12:02 -0600
commit5236de6cc1ee3759567e0fd8cd6260386b8d5b7e (patch)
treef7dea5ac7e775bb6114cb8b5de74f4e4e30ee2c8 /meson.build
parenta5329cd990cd1b85e2755f708fd9e48ac06b99a7 (diff)
downloadexternal-libgbm-5236de6cc1ee3759567e0fd8cd6260386b8d5b7e.tar.gz
external-libgbm-5236de6cc1ee3759567e0fd8cd6260386b8d5b7e.tar.xz
external-libgbm-5236de6cc1ee3759567e0fd8cd6260386b8d5b7e.zip
meson: use pkg-config to detect libatomic_ops
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build4
1 files changed, 3 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index c803f709..df6f2bd2 100644
--- a/meson.build
+++ b/meson.build
@@ -48,6 +48,7 @@ cc = meson.get_compiler('c')
48intel_atomics = false 48intel_atomics = false
49lib_atomics = false 49lib_atomics = false
50 50
51dep_atomic_ops = dependency('atomic_ops', required : false)
51if cc.compiles(''' 52if cc.compiles('''
52 int atomic_add(int *i) { return __sync_add_and_fetch (i, 1); } 53 int atomic_add(int *i) { return __sync_add_and_fetch (i, 1); }
53 int atomic_cmpxchg(int *i, int j, int k) { return __sync_val_compare_and_swap (i, j, k); } 54 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('''
55 name : 'Intel Atomics') 56 name : 'Intel Atomics')
56 intel_atomics = true 57 intel_atomics = true
57 with_atomics = true 58 with_atomics = true
58elif cc.has_header('atomic_ops.h') 59 dep_atomic_ops = []
60elif dep_atomic_ops.found()
59 lib_atomics = true 61 lib_atomics = true
60 with_atomics = true 62 with_atomics = true
61elif cc.has_function('atomic_cas_uint') 63elif cc.has_function('atomic_cas_uint')