aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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')