From 9a362bd149000d701df39428d2f1d329101c2ed4 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 26 May 2023 00:19:04 +0530 Subject: [PATCH] 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. --- meson.build | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/meson.build b/meson.build index 580c131..fb06073 100644 --- a/meson.build +++ b/meson.build @@ -34,6 +34,17 @@ cpp = meson.get_compiler('cpp') 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 + #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 = [] os_cflags = [] os_deps = []