mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
meson: warn if -mms-bitfields is necessary
GCC >= 4.7 and clang >= 12 don't need it. It should be left to the user to decide what ABI convention should be used, and it creates some issues with some tools to have this flag in cflags. We leave the flag for now, but print a warning at compile time so people get a chance to change their build system before we drop it from glib.pc Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
65e7a10d2a
commit
4dde72e038
14
meson.build
14
meson.build
@ -2358,6 +2358,20 @@ if host_system == 'windows' and cc.get_id() != 'msvc' and cc.get_id() != 'clang-
|
||||
# Ensure MSVC-compatible struct packing convention is used when
|
||||
# compiling for Win32 with gcc. It is used for the whole project and exposed
|
||||
# in glib-2.0.pc.
|
||||
if not cc.compiles('''
|
||||
struct _GTestMSBitfields
|
||||
{
|
||||
int a : 1;
|
||||
short b : 1;
|
||||
};
|
||||
|
||||
typedef char _StaticCheck[sizeof(struct _GTestMSBitfields) != sizeof(int) ? 1 : -1];
|
||||
''')
|
||||
warning('''
|
||||
Your compiler does not have ms-bitfields packing by default.
|
||||
Please use gcc >= 4.7 or clang >= 12: GLib will drop -mms-bitfields in the future.
|
||||
''')
|
||||
endif
|
||||
win32_cflags = ['-mms-bitfields']
|
||||
add_project_arguments(win32_cflags, language : 'c')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user