Meson: Add -Wl,-z,nodelete and -Wl,-Bsymbolic-functions where supported

https://bugzilla.gnome.org/show_bug.cgi?id=788771
This commit is contained in:
Xavier Claessens 2018-04-24 16:36:50 -04:00
parent 9d12af9ef8
commit a67dc37e9c
2 changed files with 14 additions and 1 deletions

View File

@ -1,6 +1,6 @@
project('glib', 'c', 'cpp',
version : '2.57.0',
meson_version : '>= 0.45.0',
meson_version : '>= 0.46.0',
default_options : [
'buildtype=debugoptimized',
'warning_level=1',
@ -337,11 +337,19 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
'-Werror=missing-prototypes',
'-Werror=pointer-arith',
]
test_c_link_args = [
'-Wl,-z,nodelete',
]
if get_option('bsymbolic_functions')
test_c_link_args += ['-Wl,-Bsymbolic-functions']
endif
else
test_c_args = []
test_c_link_args = []
endif
add_project_arguments(cc.get_supported_arguments(test_c_args), language: 'c')
add_project_link_arguments(cc.get_supported_link_arguments(test_c_link_args), language: 'c')
# Windows Support (Vista+)
if host_system == 'windows'

View File

@ -63,3 +63,8 @@ option('gtk_doc',
type : 'boolean',
value : false,
description : 'use gtk-doc to build documentation')
option('bsymbolic_functions',
type : 'boolean',
value : true,
description : 'link with -Bsymbolic-functions if supported')