Use the links() method instead of compiles() for checking whether
-latomic needs to be added to linker invocations as compiles() does not
perform the linking step and is therefore not appropriate for carrying
out this kind of checks.
'''
# meson_version (>=1.7.0) : new custom dependency for atomic
-if not cc.compiles(atomic_test, name: 'usage of atomics without -latomic')
+if not cc.links(atomic_test, name: 'usage of atomics without -latomic')
atomic_dep = declare_dependency(link_args: '-latomic')
- if not cc.compiles(
+ if not cc.links(
atomic_test,
dependencies: atomic_dep,
name: 'usage of atomics with -latomic',