[gtk/ebassi/for-master: 1/7] build: Use get_supported_link_arguments()




commit a5986f0dcddf4c82ed95ca79bd855fca71b21887
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Dec 15 11:19:39 2020 +0000

    build: Use get_supported_link_arguments()
    
    Instead of hand-coding it ourselves, let Meson deal with linker
    arguments discovery.

 meson.build | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/meson.build b/meson.build
index f4a8e36f03..dc34c09123 100644
--- a/meson.build
+++ b/meson.build
@@ -319,15 +319,11 @@ if get_option('default_library') != 'static'
   endif
 endif
 
-common_ldflags = []
-
-if os_unix and not os_darwin
-  foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
-    if cc.links('int main () { return 0; }', name: ldflag, args: ldflag)
-      common_ldflags += [ ldflag ]
-    endif
-  endforeach
-endif
+common_ldflags = cc.get_supported_link_arguments([
+  '-Wl,-Bsymbolic',
+  '-Wl,-z,relro',
+  '-Wl,-z,now',
+])
 
 confinc = include_directories('.')
 gdkinc = include_directories('gdk')


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