meson: Don't require cross files to set host_system = ios

It's not specified as a host_system by meson, so people will often not
set it.
This commit is contained in:
Nirbheek Chauhan 2023-05-26 00:19:04 +05:30
parent 8366ff0ce0
commit 9a362bd149

View File

@ -34,6 +34,17 @@ cpp = meson.get_compiler('cpp')
host_system = host_machine.system() host_system = host_machine.system()
# Don't rely on the cross file setting the system properly when targeting ios
if host_system == 'darwin' and meson.is_cross_build()
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
platform_cflags = [] platform_cflags = []
os_cflags = [] os_cflags = []
os_deps = [] os_deps = []