]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: use has_link_argument() and friends
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 15 May 2018 11:18:24 +0000 (20:18 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 23 Jul 2018 16:31:22 +0000 (01:31 +0900)
This bumps the minimum required version of meson to 0.46, as
`has_link_argument()` and friends are supported since 0.46.

README
meson.build
tools/meson-link-test.c [deleted file]

diff --git a/README b/README
index 25e1631c0f649669961444a509bb9f8ac4a8805d..6801d0dc2d53d33dd490f779411db5a83cd97480 100644 (file)
--- a/README
+++ b/README
@@ -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
index 26ef5b925d83881722802e1237aa6091238392b1..437c71a3b2c7529dc9df0e89b72c07651d447666 100644 (file)
@@ -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 (file)
index 825bbff..0000000
+++ /dev/null
@@ -1 +0,0 @@
-int main(void) {return 0;}