build: Check relro support using cc.has_link_argument

Meson 0.46 added cc.has_link_argument, which allows us to get rid
of the cc.links hack.
This commit is contained in:
Jan Tojnar
2018-10-16 19:43:55 +02:00
parent 55372c5228
commit fd395eb067

View File

@ -128,7 +128,7 @@ if not get_option('buildtype').startswith('debug')
endif
foreach link_arg: test_link_args
if cc.links('int main () { return 0; }', name: link_arg, args: link_arg)
if cc.has_link_argument(link_arg)
global_link_args += link_arg
endif
endforeach