meson: Support any compiler with gcc or msvc argument syntax

This includes e.g. clang-cl.
This commit is contained in:
Xavier Claessens 2023-06-01 08:26:49 -04:00
parent ff037052bc
commit ce182817b4
1 changed files with 2 additions and 4 deletions

View File

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