mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
meson: use has_link_argument() and friends
This bumps the minimum required version of meson to 0.46, as `has_link_argument()` and friends are supported since 0.46.
This commit is contained in:
parent
ac09340e85
commit
7a6397d2b3
2
README
2
README
@ -162,7 +162,7 @@ REQUIREMENTS:
|
|||||||
docbook-xsl (optional, required for documentation)
|
docbook-xsl (optional, required for documentation)
|
||||||
xsltproc (optional, required for documentation)
|
xsltproc (optional, required for documentation)
|
||||||
python-lxml (optional, required to build the indices)
|
python-lxml (optional, required to build the indices)
|
||||||
python >= 3.5, meson >= 0.45, ninja
|
python >= 3.5, meson >= 0.46, ninja
|
||||||
gcc, awk, sed, grep, m4, and similar tools
|
gcc, awk, sed, grep, m4, and similar tools
|
||||||
|
|
||||||
During runtime, you need the following additional
|
During runtime, you need the following additional
|
||||||
|
23
meson.build
23
meson.build
@ -9,7 +9,7 @@ project('systemd', 'c',
|
|||||||
'sysconfdir=/etc',
|
'sysconfdir=/etc',
|
||||||
'localstatedir=/var',
|
'localstatedir=/var',
|
||||||
],
|
],
|
||||||
meson_version : '>= 0.45',
|
meson_version : '>= 0.46',
|
||||||
)
|
)
|
||||||
|
|
||||||
libsystemd_version = '0.23.0'
|
libsystemd_version = '0.23.0'
|
||||||
@ -362,6 +362,7 @@ if get_option('buildtype') != 'debug'
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
|
add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
|
||||||
|
add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c')
|
||||||
|
|
||||||
# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
|
# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
|
||||||
# arguments, just emits a warning. So test for the "positive" version instead.
|
# arguments, just emits a warning. So test for the "positive" version instead.
|
||||||
@ -389,18 +390,6 @@ if cc.compiles('''
|
|||||||
add_project_arguments('-Werror=shadow', language : 'c')
|
add_project_arguments('-Werror=shadow', language : 'c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
link_test_c = files('tools/meson-link-test.c')
|
|
||||||
|
|
||||||
foreach arg : possible_link_flags
|
|
||||||
have = run_command(check_compilation_sh,
|
|
||||||
cc.cmd_array(), '-x', 'c', arg,
|
|
||||||
'-include', link_test_c).returncode() == 0
|
|
||||||
message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
|
|
||||||
if have
|
|
||||||
add_project_link_arguments(arg, language : 'c')
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
cpp = ' '.join(cc.cmd_array()) + ' -E'
|
cpp = ' '.join(cc.cmd_array()) + ' -E'
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
@ -2766,13 +2755,7 @@ foreach tuple : sanitizers
|
|||||||
sanitizer = tuple[0]
|
sanitizer = tuple[0]
|
||||||
build = tuple[1]
|
build = tuple[1]
|
||||||
|
|
||||||
have = run_command(check_compilation_sh,
|
if cc.has_link_argument('-fsanitize=@0@'.format(sanitizer))
|
||||||
cc.cmd_array(), '-x', 'c',
|
|
||||||
'-fsanitize=@0@'.format(sanitizer),
|
|
||||||
'-include', link_test_c).returncode() == 0
|
|
||||||
message('@0@ sanitizer supported: @1@'.format(sanitizer, have ? 'yes' : 'no'))
|
|
||||||
|
|
||||||
if have
|
|
||||||
prev = ''
|
prev = ''
|
||||||
foreach p : fuzz_regression_tests
|
foreach p : fuzz_regression_tests
|
||||||
b = p.split('/')[-2]
|
b = p.split('/')[-2]
|
||||||
|
@ -1 +0,0 @@
|
|||||||
int main(void) {return 0;}
|
|
Loading…
Reference in New Issue
Block a user