meson: specify when commands need to succeed in run_command

meson in git master now warns about a missing `check:` kwarg, and may
eventually change the default from false to true.

Take the opportunity to require `objcopy --help` to succeed -- it is
unlikely to fail, but if it does something insane happened.
This commit is contained in:
Eli Schwartz 2021-11-24 00:31:18 -05:00
parent 467bcacc56
commit b248f3481c
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -17,7 +17,7 @@ if build_machine.system() == 'linux'
libutil_name = 'libutil'
libutil = run_command('sh', '-c',
'''ldconfig -p | grep -o "[[:space:]]@0@\.so\(\.[0-9]\+\)\?\b"'''
.format(libutil_name)).stdout().strip().split('\n')
.format(libutil_name), check: false).stdout().strip().split('\n')
if libutil.length() > 0
message('Found libutil as @0@'.format(libutil[0]))
@ -683,7 +683,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
objcopy_supports_add_symbol = false
objcopy = find_program('objcopy', required : false)
if objcopy.found()
objcopy_supports_add_symbol = run_command(objcopy, '--help').stdout().contains('--add-symbol')
objcopy_supports_add_symbol = run_command(objcopy, '--help', check: true).stdout().contains('--add-symbol')
endif
ld = find_program('ld', required : false)