Skip to content

Commit

Permalink
Add Apple visionOS support
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinPerez committed Apr 25, 2024
1 parent 7bc7672 commit 9ca244f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ untrusted = { version = "0.9" }
[target.'cfg(any(target_arch = "aarch64", target_arch = "arm", target_arch = "x86",target_arch = "x86_64"))'.dependencies]
spin = { version = "0.9.8", default-features = false, features = ["once"] }

[target.'cfg(all(any(target_os = "android", target_os = "linux", any(target_os = "ios", target_os = "macos", target_os = "tvos")), any(target_arch = "aarch64", target_arch = "arm")))'.dependencies]
[target.'cfg(all(any(target_os = "android", target_os = "linux", any(target_os = "ios", target_os = "macos", target_os = "tvos", target_os = "visionos")), any(target_arch = "aarch64", target_arch = "arm")))'.dependencies]
libc = { version = "0.2.148", default-features = false }

[target.'cfg(all(target_arch = "aarch64", target_os = "windows"))'.dependencies]
Expand All @@ -175,7 +175,7 @@ wasm-bindgen-test = { version = "0.3.37", default-features = false }
libc = { version = "0.2.148", default-features = false }

[build-dependencies]
cc = { version = "1.0.83", default-features = false }
cc = { version = "1.0.94", default-features = false }

[features]
# These features are documented in the top-level module's documentation.
Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const NASM: &str = "nasm";

/// Operating systems that have the same ABI as macOS on every architecture
/// mentioned in `ASM_TARGETS`.
const MACOS_ABI: &[&str] = &["ios", MACOS, "tvos"];
const MACOS_ABI: &[&str] = &["ios", MACOS, "tvos", "visionos"];

const MACOS: &str = "macos";
const WINDOWS: &str = "windows";
Expand Down
14 changes: 12 additions & 2 deletions src/cpu/arm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ fn detect_features() -> u32 {

#[cfg(all(
target_arch = "aarch64",
any(target_os = "ios", target_os = "macos", target_os = "tvos")
any(
target_os = "ios",
target_os = "macos",
target_os = "tvos",
target_os = "visionos"
)
))]
fn detect_features() -> u32 {
// TODO(MSRV 1.64): Use `name: &core::ffi::CStr`.
Expand Down Expand Up @@ -225,7 +230,12 @@ fn detect_features() -> u32 {
target_os = "fuchsia",
all(target_os = "linux", not(target_env = "uclibc")),
target_os = "windows",
any(target_os = "ios", target_os = "macos", target_os = "tvos"),
any(
target_os = "ios",
target_os = "macos",
target_os = "tvos",
target_os = "visionos"
),
))
))]
fn detect_features() -> u32 {
Expand Down
1 change: 1 addition & 0 deletions src/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ impl crate::sealed::Sealed for SystemRandom {}
target_os = "redox",
target_os = "solaris",
target_os = "tvos",
target_os = "visionos",
target_os = "vita",
target_os = "windows",
all(
Expand Down

0 comments on commit 9ca244f

Please sign in to comment.