meson: fix linker checks

This commit is contained in:
Christian Hergert
2018-10-08 17:45:55 -07:00
parent 1a1cdd190e
commit f4870fdd38

View File

@ -122,12 +122,12 @@ 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_global_link_arguments(global_link_args, language: 'c')
add_project_link_arguments(global_link_args, language: 'c')
if not cc.links('''
#include <stdatomic.h>