From ee6622a6f3b48ab4af7aa26f4d788dde25b705a8 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 16 Sep 2022 23:04:18 +0800 Subject: pass ios host machine to trybuild --- xmake/modules/private/action/trybuild/meson.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/xmake/modules/private/action/trybuild/meson.lua b/xmake/modules/private/action/trybuild/meson.lua index 8c6882986..822f72e00 100644 --- a/xmake/modules/private/action/trybuild/meson.lua +++ b/xmake/modules/private/action/trybuild/meson.lua @@ -143,7 +143,27 @@ function _get_cross_file(buildir) -- host machine file:print("[host_machine]") if is_plat("iphoneos", "macosx") then - -- TODO + local cpu + local cpu_family + if is_arch("arm64") then + cpu = "aarch64" + cpu_family = "aarch64" + elseif is_arch("armv7") then + cpu = "arm" + cpu_family = "arm" + elseif is_arch("x64", "x86_64") then + cpu = "x86_64" + cpu_family = "x86_64" + elseif is_arch("x86", "i386") then + cpu = "i686" + cpu_family = "x86" + else + raise("unsupported arch(%s)", config.arch()) + end + file:print("system = 'darwin'") + file:print("cpu_family = '%s'", cpu_family) + file:print("cpu = '%s'", cpu) + file:print("endian = 'little'") elseif is_plat("android") then -- TODO elseif is_plat("mingw") then -- cgit v1.3.1