From e36f921d133c29dcd04065019c578cfe7f419fc3 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 16 Sep 2022 23:04:10 +0800 Subject: pass ios host machine --- xmake/modules/package/tools/meson.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'xmake/modules') diff --git a/xmake/modules/package/tools/meson.lua b/xmake/modules/package/tools/meson.lua index a9bb29012..9657a8e10 100644 --- a/xmake/modules/package/tools/meson.lua +++ b/xmake/modules/package/tools/meson.lua @@ -157,7 +157,27 @@ function _get_cross_file(package, opt) if opt.host_machine then file:print("%s", opt.host_machine) elseif package:is_plat("iphoneos", "macosx") then - -- TODO + local cpu + local cpu_family + if package:is_arch("arm64") then + cpu = "aarch64" + cpu_family = "aarch64" + elseif package:is_arch("armv7") then + cpu = "arm" + cpu_family = "arm" + elseif package:is_arch("x64", "x86_64") then + cpu = "x86_64" + cpu_family = "x86_64" + elseif package:is_arch("x86", "i386") then + cpu = "i686" + cpu_family = "x86" + else + raise("unsupported arch(%s)", package:arch()) + end + file:print("system = 'darwin'") + file:print("cpu_family = '%s'", cpu_family) + file:print("cpu = '%s'", cpu) + file:print("endian = 'little'") elseif package:is_plat("android") then -- TODO elseif package:is_plat("mingw") then -- cgit v1.3.1