Skip to content

Commit

Permalink
Merge pull request #317 from thomcc/tvos-watchos
Browse files Browse the repository at this point in the history
Add tvOS and watchOS support, identical to iOS support
  • Loading branch information
josephlr authored Oct 25, 2022
2 parents 2aabb63 + e32ea82 commit 8e44d13
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `*‑apple‑darwin` | [`getentropy`][3] if available, otherwise [`/dev/urandom`][4] (identical to `/dev/random`)
//! | iOS | `*‑apple‑ios` | [`SecRandomCopyBytes`]
//! | iOS, tvOS, watchOS | `*‑apple‑ios`, `*-apple-tvos`, `*-apple-watchos` | [`SecRandomCopyBytes`]
//! | FreeBSD | `*‑freebsd` | [`getrandom`][5] if available, otherwise [`kern.arandom`][6]
//! | OpenBSD | `*‑openbsd` | [`getentropy`][7]
//! | NetBSD | `*‑netbsd` | [`kern.arandom`][8]
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8e44d13

Please sign in to comment.