Do not test for linker flags
authorEmmanuele Bassi <ebassi@gnome.org>
Mon, 26 Mar 2018 10:48:30 +0000 (11:48 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 27 Mar 2018 11:47:05 +0000 (12:47 +0100)
Meson warns when doing that, as it's not really portable.

Since we're using platform-specific linker flags on Darwin, we can also
do the same on Linux; the syntax is GCC-specific, so we're going to need
Clang users to test it.

meson.build

index 26d522fa3bc88df640c326dc0758e02c31df22bb..5831dfcbfef8b98d7e188b58630a51cc0c330a07 100644 (file)
@@ -279,12 +279,8 @@ endif
 
 common_ldflags = []
 
-if host_machine.system() == 'linux'
-  foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
-    if cc.has_argument(ldflag)
-      common_ldflags += [ ldflag ]
-    endif
-  endforeach
+if host_machine.system() == 'linux' and cc.get_id() == 'gcc'
+  common_ldflags += [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
 endif
 
 # Maintain compatibility with autotools