From: Michał Kępień Date: Mon, 23 Jun 2025 08:23:17 +0000 (+0200) Subject: Use links() for checking if -latomic is necessary X-Git-Tag: v9.21.10~38^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b06d3f6c771addafcb76aaffdd79005dad8f5c2d;p=thirdparty%2Fbind9.git Use links() for checking if -latomic is necessary 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. --- diff --git a/meson.build b/meson.build index 49989944df9..8568197ee17 100644 --- a/meson.build +++ b/meson.build @@ -383,9 +383,9 @@ int main(void) { ''' # 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',