diff options
| author | ruki <[email protected]> | 2026-02-11 00:52:29 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-02-11 00:52:29 +0800 |
| commit | 2e9e484793bc705d2f0c2911040ca87e753eb205 (patch) | |
| tree | 98452a2614431ffb8735819f4e4eb49fc27942d6 | |
| parent | 11ef7112b1b8468bfe413e161d99f56ecc8703f5 (diff) | |
improve xcode triple
| -rw-r--r-- | xmake/modules/private/utils/toolchain.lua | 24 |
1 files 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 |
