build: Use get_supported_link_arguments()

Instead of hand-coding it ourselves, let Meson deal with linker
arguments discovery.
This commit is contained in:
Emmanuele Bassi 2020-12-15 11:19:39 +00:00
parent c162d7148f
commit a5986f0dcd

View File

@ -319,15 +319,11 @@ if get_option('default_library') != 'static'
endif endif
endif endif
common_ldflags = [] common_ldflags = cc.get_supported_link_arguments([
'-Wl,-Bsymbolic',
if os_unix and not os_darwin '-Wl,-z,relro',
foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ] '-Wl,-z,now',
if cc.links('int main () { return 0; }', name: ldflag, args: ldflag) ])
common_ldflags += [ ldflag ]
endif
endforeach
endif
confinc = include_directories('.') confinc = include_directories('.')
gdkinc = include_directories('gdk') gdkinc = include_directories('gdk')