meson: use has_link_argument() to check linker flags support

This commit is contained in:
Antonio Cardace 2019-12-19 09:25:02 +01:00
parent a3c9dccfd0
commit 65572f5329

View file

@ -154,10 +154,14 @@ if enable_ld_gc
test_ldflags = ['-Wl,--gc-sections']
foreach cflag: test_c_flags + test_ldflags
foreach cflag: test_c_flags
assert(cc.has_argument(cflag), 'Unused symbol eviction requested but not supported. Use -Dld_gc=false to build without it.')
endforeach
foreach ldflag: test_ldflags
assert(cc.has_link_argument(ldflag), 'Linker garbage collection requested but not supported. Use -Dld_gc=false to build without it.')
endforeach
common_flags += test_c_flags
common_ldflags += test_ldflags
endif