meson: Fix build failure when compiler is not in PATH

When cross compiling gcc/clang could not exist in PATH and Meson could
be using aarch64-linux-android-clang set in a cross file for example.
This commit is contained in:
Xavier Claessens 2020-10-03 22:04:04 -04:00
parent 73353b3376
commit abc723366d
1 changed files with 4 additions and 3 deletions

View File

@ -31,12 +31,13 @@ fc_sources = [
] ]
# FIXME: obviously fragile, cc.preprocess would be sweet # FIXME: obviously fragile, cc.preprocess would be sweet
cpp = cc.cmd_array()
if cc.get_id() == 'gcc' if cc.get_id() == 'gcc'
cpp = ['gcc', '-E', '-P'] cpp += ['-E', '-P']
elif cc.get_id() == 'msvc' elif cc.get_id() == 'msvc'
cpp = ['cl', '/EP'] cpp += ['/EP']
elif cc.get_id() == 'clang' elif cc.get_id() == 'clang'
cpp = ['clang', '-E', '-P'] cpp += ['-E', '-P']
else else
error('FIXME: implement cc.preprocess') error('FIXME: implement cc.preprocess')
endif endif