meson: Compile some tests with multiple C standards

We need to ensure that all the expected macros and utilities are working
with all the supported C standards, so just repeat the tests with all
the ones the compiler supports.
This commit is contained in:
Marco Trevisan (Treviño)
2022-09-14 04:15:58 +02:00
parent 641256ea22
commit 14ba699508
2 changed files with 30 additions and 2 deletions

View File

@@ -10,6 +10,15 @@ project('glib', 'c',
)
cc = meson.get_compiler('c')
c_standards = {}
foreach std : ['90', '99', '11', '17']
arg = (cc.get_id() == 'msvc' ? '/std:' : '-std=') + 'c' + std
if cc.has_argument(arg)
c_standards += { std: arg }
endif
endforeach
have_cxx = add_languages('cpp', native: false, required: get_option('oss_fuzz').enabled())
if have_cxx
cxx = meson.get_compiler('cpp')