Merge pull request #317 from thomcc/tvos-watchos

Add tvOS and watchOS support, identical to iOS support
This commit is contained in:
Joseph Richey 2022-10-25 02:50:29 -07:00 committed by GitHub
commit 8e44d13ebf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 5 deletions

View File

@ -152,12 +152,14 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@nightly
with:
targets: aarch64-apple-darwin, aarch64-apple-ios
components: rust-src
- uses: Swatinem/rust-cache@v2
- run: cargo test --no-run --target=aarch64-apple-darwin --features=std
- run: cargo test --no-run --target=aarch64-apple-ios --features=std
- run: cargo test --no-run --target=aarch64-apple-watchos-sim -Zbuild-std --features=std
cross-link:
name: Cross Build/Link
@ -273,6 +275,9 @@ jobs:
aarch64-kmc-solid_asp3,
armv6k-nintendo-3ds,
riscv32imc-esp-espidf,
# `std` support still in progress. Can be moved up with the other
# apple targets after https://github.com/rust-lang/rust/pull/103503
aarch64-apple-tvos,
]
include:
# Supported tier 3 targets without libstd support

View File

@ -18,7 +18,7 @@ compiler_builtins = { version = "0.1", optional = true }
core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" }
[target.'cfg(unix)'.dependencies]
libc = { version = "0.2.128", default-features = false }
libc = { version = "0.2.136", default-features = false }
[target.'cfg(target_os = "wasi")'.dependencies]
wasi = { version = "0.11", default-features = false }

View File

@ -15,7 +15,7 @@
//! | Linux, Android | `*linux*` | [`getrandom`][1] system call if available, otherwise [`/dev/urandom`][2] after successfully polling `/dev/random`
//! | Windows | `*windows*` | [`BCryptGenRandom`]
//! | macOS | `*appledarwin` | [`getentropy`][3] if available, otherwise [`/dev/urandom`][4] (identical to `/dev/random`)
//! | iOS | `*appleios` | [`SecRandomCopyBytes`]
//! | iOS, tvOS, watchOS | `*appleios`, `*-apple-tvos`, `*-apple-watchos` | [`SecRandomCopyBytes`]
//! | FreeBSD | `*freebsd` | [`getrandom`][5] if available, otherwise [`kern.arandom`][6]
//! | OpenBSD | `*openbsd` | [`getentropy`][7]
//! | NetBSD | `*netbsd` | [`kern.arandom`][8]
@ -229,8 +229,8 @@ cfg_if! {
#[path = "dragonfly.rs"] mod imp;
} else if #[cfg(target_os = "fuchsia")] {
#[path = "fuchsia.rs"] mod imp;
} else if #[cfg(target_os = "ios")] {
#[path = "ios.rs"] mod imp;
} else if #[cfg(any(target_os = "ios", target_os = "watchos", target_os = "tvos"))] {
#[path = "apple-other.rs"] mod imp;
} else if #[cfg(target_os = "macos")] {
mod util_libc;
mod use_file;