]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Remove check-compilation.sh
authorJan Janssen <medhefgo@web.de>
Mon, 2 May 2022 08:55:53 +0000 (10:55 +0200)
committerJan Janssen <medhefgo@web.de>
Wed, 4 May 2022 13:59:51 +0000 (15:59 +0200)
No need to involve a trivial shell script for this.

We could call the compiler directly, but test() expects arguments
to be passed separately and cc.cmd_array() can contain arguments
itself. Using env is easier than manually slicing the array because
meson has no builtins for that.

meson.build
src/systemd/meson.build
tools/check-compilation.sh [deleted file]

index 582e33c9a73d103c57f021066999528ecacae4de..ef532e421f6269aa9ba53074f6fe0c23fd8e8eb9 100644 (file)
@@ -289,7 +289,6 @@ conf.set_quoted('STATUS_UNIT_FORMAT_DEFAULT_STR',             status_unit_format
 
 cc = meson.get_compiler('c')
 pkgconfig = import('pkgconfig')
-check_compilation_sh = find_program('tools/check-compilation.sh')
 meson_build_sh = find_program('tools/meson-build.sh')
 
 want_tests = get_option('tests')
index 9302d6ca2e0216eb69b6031902bd681739efaf1b..ea73f92af5701bb480ae6a887bddac47dfff9de0 100644 (file)
@@ -77,11 +77,14 @@ endif
 foreach header : _systemd_headers + _not_installed_headers + [libudev_h_path]
         foreach opt : opts
                 std_name = opt.length() == 2 ? '_'.join(opt[1].split(':')) : ''
-                name = ''.join(['cc-', header.split('/')[-1], '_', opt[0], std_name])
-                test(name,
-                     check_compilation_sh,
-                     args : cc.cmd_array() + ['-c', '-x'] + opt +
-                             ['-Werror', '-include',
-                             meson.current_source_dir() / header])
+                test('cc-' + header.split('/')[-1] + '_' + opt[0] + std_name,
+                     env,
+                     args : [cc.cmd_array(),
+                             '-c',
+                             '-x', opt,
+                             '-Werror',
+                             '-include', meson.current_source_dir() / header,
+                             '-o/dev/null',
+                             '/dev/null'])
         endforeach
 endforeach
diff --git a/tools/check-compilation.sh b/tools/check-compilation.sh
deleted file mode 100755 (executable)
index c2fe3aa..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: LGPL-2.1-or-later
-set -eu
-
-"$@" '-' -o/dev/null </dev/null