diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2022-10-19 16:40:15 +0200 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2022-10-20 15:10:41 +0200 |
commit | b0b534170adcf233e49ebcc2cb22c447ee60ae90 (patch) | |
tree | b4298c49d2a6692dcb8ff143ffe8467829cae168 | |
parent | 1db9066485b466162324e651d61d91ca01db7d60 (diff) | |
download | glib-b0b534170adcf233e49ebcc2cb22c447ee60ae90.tar.gz |
meson: Cleanup computation of glib OS and their definition
-rw-r--r-- | meson.build | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/meson.build b/meson.build index 54445db69..73285f7a8 100644 --- a/meson.build +++ b/meson.build @@ -230,18 +230,24 @@ endif # 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_UNIX -#define G_WITH_CYGWIN''' -elif host_system in ['darwin', 'ios'] - glib_os = '''#define G_OS_UNIX -#define G_OS_DARWIN''' + glib_os = [ + 'G_OS_WIN32', + 'G_PLATFORM_WIN32', + ] else - glib_os = '#define G_OS_UNIX' + glib_os = ['G_OS_UNIX'] + + if host_system == 'cygwin' + glib_os += 'G_WITH_CYGWIN' + elif host_system in ['darwin', 'ios'] + glib_os += 'G_OS_DARWIN' + endif endif -glibconfig_conf.set('glib_os', glib_os) +glib_os_defines = [] +foreach os : glib_os + glib_os_defines += '#define @0@'.format(os) +endforeach +glibconfig_conf.set('glib_os', '\n'.join(glib_os_defines)) # We need to know the CRT being used to determine what .lib files we need on # Visual Studio for dependencies that don't normally come with pkg-config files |