summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2023-05-26 00:19:04 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2023-05-26 00:45:29 +0530
commit9a362bd149000d701df39428d2f1d329101c2ed4 (patch)
treee5aa29808e951cdcfba26766bceaed59bc7ffc3b
parent8366ff0ce012bfe37739adb4454604bc3d632f96 (diff)
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.
-rw-r--r--meson.build11
1 files changed, 11 insertions, 0 deletions
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 <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 = []
os_cflags = []
os_deps = []