1
0
mirror of https://gitlab.gnome.org/GNOME/glib.git synced 2026-10-24 00:49:00 +03:00

meson: Remove host_system = ios and warn if cross files set it

Prior to the addition of subsystem support in Meson, people who wanted
to cross-compile to iOS often set `system = 'ios'` in the cross file and
meson happily plumbed that to `host_machine.system()`.

However, we now use subsystems, so we should stop accepting
host_system == ios.
This commit is contained in:
Nirbheek Chauhan
2026-01-27 23:20:58 +05:30
parent 9e0cc4fc8a
commit 2556270ff0
3 changed files with 8 additions and 14 deletions

View File

@@ -271,7 +271,7 @@ else
install_tag : 'tests',
install: installed_tests_enabled)
if host_system not in ['ios', 'darwin']
if host_system != 'darwin'
var_preload = 'LD_PRELOAD'
else
var_preload = 'DYLD_INSERT_LIBRARIES'

View File

@@ -26,7 +26,7 @@ endif
module_suffix = []
# Keep the autotools convention for shared module suffix because GModule
# depends on it: https://gitlab.gnome.org/GNOME/glib/issues/520
if ['darwin', 'ios'].contains(host_machine.system())
if host_system == 'darwin'
module_suffix = 'so'
endif

View File

@@ -71,16 +71,6 @@ endif
host_system = host_machine.system()
subsystem = ''
if host_system == 'darwin'
ios_test_code = '''#include <TargetConditionals.h>
#if ! TARGET_OS_IPHONE
#error "Not iOS/tvOS/watchOS/iPhoneSimulator"
#endif'''
if cc.compiles(ios_test_code, name : 'building for iOS')
host_system = 'ios'
endif
endif
linux_libc = ''
if host_system == 'linux'
musl_test_code = '''#include <stdlib.h>
@@ -92,6 +82,10 @@ if host_system == 'linux'
endif
elif host_system == 'darwin'
subsystem = host_machine.subsystem()
elif host_system == 'ios'
warning('Setting system = \'ios\' in cross files is deprecated, please use subsystem names')
host_system = 'darwin'
subsystem = 'ios'
endif
glib_version = meson.project_version()
@@ -1239,7 +1233,7 @@ if host_system == 'windows' and (cc.get_id() == 'msvc' or cc.get_id() == 'clang-
glib_conf.set('HAVE_C99_SNPRINTF', false)
glib_conf.set('HAVE_C99_VSNPRINTF', false)
glib_conf.set('HAVE_UNIX98_PRINTF', false)
elif not cc_can_run and host_system in ['ios', 'darwin']
elif not cc_can_run and host_system == 'darwin'
# All these are true when compiling natively on macOS, so we should use good
# defaults when building for iOS and tvOS.
glib_conf.set('HAVE_C99_SNPRINTF', true)
@@ -2590,7 +2584,7 @@ if host_system == 'windows'
export_dynamic_ldflags = []
elif host_system == 'cygwin'
export_dynamic_ldflags = ['-Wl,--export-all-symbols']
elif host_system in ['darwin', 'ios']
elif host_system == 'darwin'
export_dynamic_ldflags = []
elif host_system == 'sunos'
export_dynamic_ldflags = []