From 2e9e484793bc705d2f0c2911040ca87e753eb205 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 11 Feb 2026 00:52:29 +0800 Subject: improve xcode triple --- xmake/modules/private/utils/toolchain.lua | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/xmake/modules/private/utils/toolchain.lua b/xmake/modules/private/utils/toolchain.lua index 5ce20d713..d6f320a05 100644 --- a/xmake/modules/private/utils/toolchain.lua +++ b/xmake/modules/private/utils/toolchain.lua @@ -184,7 +184,16 @@ function get_clang_target_flags(toolchain) end end --- get xcode/apple target triple for clang -target, e.g. x86_64-apple-ios18.2-simulator +-- get xcode/apple target triple for clang -target +-- +-- e.g. +-- - macosx: x86_64-apple-macos14.0 +-- - macosx(catalyst): arm64-apple-macos14.0-macabi +-- - iphoneos: arm64-apple-ios18.2 +-- - iphoneos(simulator): x86_64-apple-ios18.2-simulator +-- - appletvos: arm64-apple-tvos17.0 +-- - watchos: armv7k-apple-watchos10.0 +-- - applexros(simulator): x86_64-apple-xros1.0-simulator -- -- configs: -- - appledev: simulator/catalyst @@ -203,11 +212,14 @@ function get_xcode_target_triple(toolchain) end target = target .. target_minver end - if appledev == "simulator" then - target = target .. "-simulator" - end - if appledev == "catalyst" then - target = target .. "-macabi" + if plat == "macos" then + if appledev == "catalyst" then + target = target .. "-macabi" + end + else + if appledev == "simulator" then + target = target .. "-simulator" + end end return target end -- cgit v1.3.1