]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use links() for checking if -latomic is necessary
authorMichał Kępień <michal@isc.org>
Mon, 23 Jun 2025 08:23:17 +0000 (10:23 +0200)
committerMichał Kępień <michal@isc.org>
Mon, 23 Jun 2025 08:23:17 +0000 (10:23 +0200)
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.build

index 49989944df9eba6cf1523ad14b8d26835cde6a01..8568197ee17736b55948575c35000063b39e5907 100644 (file)
@@ -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',