Closed
Description
Apple's division of OS targets is a bit odd: apps for iPhones and iPads both use an iOS or "iPhoneOS" target, but watchOS and tvOS are treated as entirely separate targets or "platforms".
rustc currently supports macOS ({x86_64,i686}-apple-darwin
), iOS ({armv7,armv7s,aarch64}-apple-ios
), and the iOS Simulator (i386-apple-ios
), but not tvOS or watchOS.
Here's the full list of platforms. (I'm not sure if the version-min argument is needed for rustc, but it would be needed in cc-rs
, which is also missing support.)
Edit (9/10/19): Changes since this was originally posted:
- Simulators now have
-simulator
in the LLVM triple, e.g.x86_64-apple-tvos12.4.0-simulator
- Catalyst (which someone already submitted a PR adding initial support for) has triples like
x86_64-apple-ios13.0-macabi
. It still uses the macOS SDK, but with a custom header/library search path. - watchOS has an additional architecture,
arm64_32
; example LLVM triple:arm64_32-apple-watchos6.0.0
.
OS Name | Xcode Platform Name | Valid Architectures | LLVM Triple | Clang -mxxx-version-min |
---|---|---|---|---|
macOS | MacOSX |
i386 x86_64 | x86_64-apple-macosx10.13.0 |
-mmacosx-version-min or -mmacos-version-min |
iOS | iPhoneOS |
arm64 armv7 armv7s | arm64-apple-ios11.2.0 |
-miphoneos-version-min or -mios-version-min |
iOS Simulator | iPhoneOSSimulator |
i386 x86_64 | x86_64-apple-ios11.2.0 |
-miphonesimulator-version-min or -mios-simulator-version-min |
watchOS | WatchOS |
armv7k | thumbv7k-apple-watchos4.2.0 |
-mwatchos-version-min |
watchOS Simulator | WatchSimulator |
i386 x86_64 | x86_64-apple-watchos4.2.0 |
-mwatchsimulator-version-min or -mwatchos-simulator-version-min |
tvOS | AppleTVOS |
arm64 | arm64-apple-tvos11.2.0 |
-mappletvos-version-min or -mtvos-version-min |
tvOS Simulator | AppleTVSimulator |
x86_64 | x86_64-apple-tvos11.2.0 |
-mappletvsimulator-version-min or -mtvos-simulator-version-min |
Example output of xcodebuild -showsdks
:
iOS SDKs:
iOS 11.2 -sdk iphoneos11.2
iOS Simulator SDKs:
Simulator - iOS 11.2 -sdk iphonesimulator11.2
macOS SDKs:
macOS 10.13 -sdk macosx10.13
tvOS SDKs:
tvOS 11.2 -sdk appletvos11.2
tvOS Simulator SDKs:
Simulator - tvOS 11.2 -sdk appletvsimulator11.2
watchOS SDKs:
watchOS 4.2 -sdk watchos4.2
watchOS Simulator SDKs:
Simulator - watchOS 4.2 -sdk watchsimulator4.2