|
| 1 | +# `*-apple-tvos` |
| 2 | +- aarch64-apple-tvos |
| 3 | +- x86_64-apple-tvos |
| 4 | + |
| 5 | +**Tier: 3** |
| 6 | + |
| 7 | +Apple WatchOS targets: |
| 8 | +- Apple tvOS on aarch64 |
| 9 | +- Apple tvOS Simulator on x86_64 |
| 10 | + |
| 11 | +## Target maintainers |
| 12 | + |
| 13 | +* [@thomcc](https://github.com/thomcc) |
| 14 | + |
| 15 | +## Requirements |
| 16 | + |
| 17 | +These targets are cross-compiled. You will need appropriate versions of XCode |
| 18 | +and the SDKs for tvOS (`AppleTVOS.sdk`) and/or the tvOS Simulator |
| 19 | +(`AppleTVSimulator.sdk`) to build a toolchain and target these platforms. |
| 20 | + |
| 21 | +The targets support the full standard library including the allocator to the |
| 22 | +best of my knowledge, however they are very new, not yet well-tested tested, and |
| 23 | +it is possible that there are various bugs. |
| 24 | + |
| 25 | +In theory we support back to tvOS version 7.0, although the actual minimum |
| 26 | +version you can target may be newer than this, for example due to the versions |
| 27 | +of XCode and your SDKs. |
| 28 | + |
| 29 | +As with the other Apple targets, `rustc` respects the common environment |
| 30 | +variables used by XCode to configure this, in this case |
| 31 | +`TVOS_DEPLOYMENT_TARGET`. |
| 32 | + |
| 33 | +## Building the target |
| 34 | + |
| 35 | +The targets can be built by enabling them for a `rustc` build, for example: |
| 36 | + |
| 37 | +```toml |
| 38 | +[build] |
| 39 | +build-stage = 1 |
| 40 | +target = ["aarch64-apple-tvos", "x86_64-apple-tvos"] |
| 41 | +``` |
| 42 | + |
| 43 | +It's possible that cargo under `-Zbuild-std` may also be used to target them. |
| 44 | + |
| 45 | +## Building Rust programs |
| 46 | + |
| 47 | +*Note: Building for this target requires the corresponding TVOS SDK, as provided by Xcode.* |
| 48 | + |
| 49 | +Rust programs can be built for these targets |
| 50 | + |
| 51 | +```text |
| 52 | +$ rustc --target aarch64-apple-tvos your-code.rs |
| 53 | +... |
| 54 | +$ rustc --target x86_64-apple-tvos your-code.rs |
| 55 | +``` |
| 56 | + |
| 57 | +## Testing |
| 58 | + |
| 59 | +There is no support for running the Rust or standard library testsuite on tvOS |
| 60 | +or the simulators at the moment. Testing has mostly been done manually with |
| 61 | +builds of static libraries called from XCode or a simulator. |
| 62 | + |
| 63 | +It hopefully will be possible to improve this in the future. |
| 64 | + |
| 65 | +## Cross-compilation toolchains and C code |
| 66 | + |
| 67 | +This target can be cross-compiled from x86_64 or aarch64 macOS hosts. |
| 68 | + |
| 69 | +Other hosts are not supported for cross-compilation, but might work when also |
| 70 | +providing the required Xcode SDK. |
0 commit comments