summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2022-09-16 23:04:10 +0800
committerruki <[email protected]>2022-09-16 23:04:10 +0800
commite36f921d133c29dcd04065019c578cfe7f419fc3 (patch)
treee05bcb1ea4517d8ad947a4545c99f3b319641307 /xmake/modules
parentb3218582b505503ea17c20de3639af5b5704d816 (diff)
pass ios host machine
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/package/tools/meson.lua22
1 files changed, 21 insertions, 1 deletions
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