mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-22 18:22:11 +01:00
build: Use override_options for C standard selection
Do not try to inject the C standard into `c_args`: Meson already generates a compiler command line with the appropriate C standard, and adding another one into it at a random position is either potentially undefined behaviour, or it's going to break the build because the compiler does not accept more than one switch. Meson has an `override_options` argument for the executable() object, and we are already using it in places.
This commit is contained in:
parent
1fb47422e9
commit
5e8e4424c4
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user