[gnome-builder] build: use cc.links() to verify -Wl link args



commit 428cc6b8544a0a4f674a2a7b43b132732622d73b
Author: Christian Hergert <chergert redhat com>
Date:   Sat Jan 27 12:53:13 2018 -0800

    build: use cc.links() to verify -Wl link args
    
    This fixes an issue where meson erroneously returns whether or not the
    linker has a feature.
    
    Fixes #369

 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index 0906b36d2..066f0b71c 100644
--- a/meson.build
+++ b/meson.build
@@ -155,9 +155,9 @@ if not get_option('buildtype').startswith('debug')
 
 endif
 
-foreach arg: test_link_args
-  if cc.has_argument(arg)
-    global_link_args += arg
+foreach link_arg: test_link_args
+  if cc.links('int main () { return 0; }', name: link_arg, args: link_arg)
+    global_link_args += link_arg
   endif
 endforeach
 add_project_link_arguments(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]