mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
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:
commit
4fde1a6cfc
@ -372,10 +372,12 @@ foreach test_name, extra_args : glib_tests
|
|||||||
'@0@-c-@1@'.format(test_name, std) : extra_args + {
|
'@0@-c-@1@'.format(test_name, std) : extra_args + {
|
||||||
'source' : extra_args.get('source', test_name + '.c'),
|
'source' : extra_args.get('source', test_name + '.c'),
|
||||||
'suite' : ['cc'] + extra_args.get('suite', []),
|
'suite' : ['cc'] + extra_args.get('suite', []),
|
||||||
'c_args' : [
|
'override_options' : extra_args.get('override_options', []) + [
|
||||||
c_standards.get(std),
|
'c_std=c@0@'.format(std),
|
||||||
'-D_G_EXPECTED_C_STANDARD="@0@"'.format(std)
|
],
|
||||||
] + extra_args.get('c_args', []),
|
'c_args' : extra_args.get('c_args', []) + [
|
||||||
|
'-D_G_EXPECTED_C_STANDARD="@0@"'.format(std),
|
||||||
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
endif
|
endif
|
||||||
|
@ -14,7 +14,7 @@ fs = import('fs')
|
|||||||
cc = meson.get_compiler('c')
|
cc = meson.get_compiler('c')
|
||||||
c_standards = {}
|
c_standards = {}
|
||||||
|
|
||||||
foreach std : ['90', '99', '11', '17']
|
foreach std : ['89', '99', '11', '17']
|
||||||
arg = (cc.get_id() == 'msvc' ? '/std:' : '-std=') + 'c' + std
|
arg = (cc.get_id() == 'msvc' ? '/std:' : '-std=') + 'c' + std
|
||||||
if cc.has_argument(arg)
|
if cc.has_argument(arg)
|
||||||
c_standards += { std: arg }
|
c_standards += { std: arg }
|
||||||
|
Loading…
Reference in New Issue
Block a user