diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-05-15 20:18:24 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-07-24 01:31:22 +0900 |
commit | 7a6397d2b35b6c1c6f0b833366d0659f4df85322 (patch) | |
tree | 13b5242735b6b47efcbf249a8fb17cd50a14c629 | |
parent | ac09340e85a2117f13770893dc5c3ae45bb35519 (diff) | |
download | systemd-7a6397d2b35b6c1c6f0b833366d0659f4df85322.tar.gz |
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.
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | meson.build | 23 | ||||
-rw-r--r-- | tools/meson-link-test.c | 1 |
3 files changed, 4 insertions, 22 deletions
@@ -162,7 +162,7 @@ REQUIREMENTS: docbook-xsl (optional, required for documentation) xsltproc (optional, required for documentation) 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 During runtime, you need the following additional diff --git a/meson.build b/meson.build index 26ef5b925d..437c71a3b2 100644 --- a/meson.build +++ b/meson.build @@ -9,7 +9,7 @@ project('systemd', 'c', 'sysconfdir=/etc', 'localstatedir=/var', ], - meson_version : '>= 0.45', + meson_version : '>= 0.46', ) libsystemd_version = '0.23.0' @@ -362,6 +362,7 @@ if get_option('buildtype') != 'debug' endif 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-" # 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') 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' ##################################################################### @@ -2766,13 +2755,7 @@ foreach tuple : sanitizers sanitizer = tuple[0] build = tuple[1] - have = run_command(check_compilation_sh, - 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 + if cc.has_link_argument('-fsanitize=@0@'.format(sanitizer)) prev = '' foreach p : fuzz_regression_tests b = p.split('/')[-2] diff --git a/tools/meson-link-test.c b/tools/meson-link-test.c deleted file mode 100644 index 825bbff05f..0000000000 --- a/tools/meson-link-test.c +++ /dev/null @@ -1 +0,0 @@ -int main(void) {return 0;} |