Set G_WITH_CYGWIN again

This macro was lost during meson migration. Set it again.

Also explain that Cygwin maintainers applied patches[0] to glib that
simply marked all G_PLATFORM_WIN32-protected code as !defined(G_WITH_CYGWIN),
i.e. they did not want that code to compile.
Instead of altering ifdef guards all over the place, we'll just
not define G_PLATFORM_WIN32 for Cygwin anymore.

[0]: 3a873fdd1b/2.36.3-not-win32.patch
This commit is contained in:
Руслан Ижбулатов 2019-03-20 19:05:19 +00:00
parent ff47bb0e53
commit 9ca7ac782e

View File

@ -188,10 +188,18 @@ if host_system == 'windows' and get_option('default_library') == 'static'
glibconfig_conf.set('GOBJECT_STATIC_COMPILATION', '1')
endif
# FIXME: what about Cygwin (G_WITH_CYGWIN)
# Cygwin glib port maintainers made it clear
# (via the patches they apply) that they want no
# part of glib W32 code, therefore we do not define
# G_PLATFORM_WIN32 for host_system == 'cygwin'.
# This makes G_PLATFORM_WIN32 a synonym for
# G_OS_WIN32.
if host_system == 'windows'
glib_os = '''#define G_OS_WIN32
#define G_PLATFORM_WIN32'''
elif host_system == 'cygwin'
glib_os = '''#define G_OS_WIN32
#define G_WITH_CYGWIN'''
else
glib_os = '#define G_OS_UNIX'
endif