1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

meson: Remove check-compilation.sh

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.
This commit is contained in:
Jan Janssen 2022-05-02 10:55:53 +02:00
parent 3d35c6d47e
commit 911c15087c
3 changed files with 9 additions and 12 deletions

View File

@ -289,7 +289,6 @@ conf.set_quoted('STATUS_UNIT_FORMAT_DEFAULT_STR', status_unit_format
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
pkgconfig = import('pkgconfig') pkgconfig = import('pkgconfig')
check_compilation_sh = find_program('tools/check-compilation.sh')
meson_build_sh = find_program('tools/meson-build.sh') meson_build_sh = find_program('tools/meson-build.sh')
want_tests = get_option('tests') want_tests = get_option('tests')

View File

@ -77,11 +77,14 @@ endif
foreach header : _systemd_headers + _not_installed_headers + [libudev_h_path] foreach header : _systemd_headers + _not_installed_headers + [libudev_h_path]
foreach opt : opts foreach opt : opts
std_name = opt.length() == 2 ? '_'.join(opt[1].split(':')) : '' std_name = opt.length() == 2 ? '_'.join(opt[1].split(':')) : ''
name = ''.join(['cc-', header.split('/')[-1], '_', opt[0], std_name]) test('cc-' + header.split('/')[-1] + '_' + opt[0] + std_name,
test(name, env,
check_compilation_sh, args : [cc.cmd_array(),
args : cc.cmd_array() + ['-c', '-x'] + opt + '-c',
['-Werror', '-include', '-x', opt,
meson.current_source_dir() / header]) '-Werror',
'-include', meson.current_source_dir() / header,
'-o/dev/null',
'/dev/null'])
endforeach endforeach
endforeach endforeach

View File

@ -1,5 +0,0 @@
#!/bin/sh
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eu
"$@" '-' -o/dev/null </dev/null