Merge branch 'ebassi/override-test-c_args' into 'main'

build: Use C89 for the standard version check

See merge request GNOME/glib!4091
This commit is contained in:
Philip Withnall 2024-05-23 08:53:00 +00:00
commit 4fde1a6cfc
2 changed files with 7 additions and 5 deletions

View File

@ -372,10 +372,12 @@ foreach test_name, extra_args : glib_tests
'@0@-c-@1@'.format(test_name, std) : extra_args + {
'source' : extra_args.get('source', test_name + '.c'),
'suite' : ['cc'] + extra_args.get('suite', []),
'c_args' : [
c_standards.get(std),
'-D_G_EXPECTED_C_STANDARD="@0@"'.format(std)
] + extra_args.get('c_args', []),
'override_options' : extra_args.get('override_options', []) + [
'c_std=c@0@'.format(std),
],
'c_args' : extra_args.get('c_args', []) + [
'-D_G_EXPECTED_C_STANDARD="@0@"'.format(std),
],
}
}
endif

View File

@ -14,7 +14,7 @@ fs = import('fs')
cc = meson.get_compiler('c')
c_standards = {}
foreach std : ['90', '99', '11', '17']
foreach std : ['89', '99', '11', '17']
arg = (cc.get_id() == 'msvc' ? '/std:' : '-std=') + 'c' + std
if cc.has_argument(arg)
c_standards += { std: arg }