Skip to content

Commit

Permalink
Modified for compilation with iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Holzschuch committed Sep 24, 2023
1 parent f8a9398 commit c83075b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cross_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::path::{Path, PathBuf};
pub fn is_cross_compiling(target: &Target) -> Result<bool> {
let target_triple = target.target_triple();
let host = target.host_triple();

if target_triple == host {
// Not cross-compiling
return Ok(false);
Expand Down
6 changes: 6 additions & 0 deletions src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub enum Os {
Linux,
Windows,
Macos,
Ios,
FreeBsd,
NetBsd,
OpenBsd,
Expand All @@ -38,6 +39,7 @@ impl fmt::Display for Os {
Os::Linux => write!(f, "Linux"),
Os::Windows => write!(f, "Windows"),
Os::Macos => write!(f, "macOS"),
Os::Ios => write!(f, "iOS"),
Os::FreeBsd => write!(f, "FreeBSD"),
Os::NetBsd => write!(f, "NetBSD"),
Os::OpenBsd => write!(f, "OpenBSD"),
Expand Down Expand Up @@ -149,6 +151,7 @@ fn get_supported_architectures(os: &Os) -> Vec<Arch> {
],
Os::Windows => vec![Arch::X86, Arch::X86_64, Arch::Aarch64],
Os::Macos => vec![Arch::Aarch64, Arch::X86_64],
Os::Ios => vec![Arch::Aarch64],
Os::FreeBsd | Os::NetBsd => vec![
Arch::Aarch64,
Arch::Armv6L,
Expand Down Expand Up @@ -230,6 +233,7 @@ impl Target {
OperatingSystem::Linux => Os::Linux,
OperatingSystem::Windows => Os::Windows,
OperatingSystem::MacOSX { .. } | OperatingSystem::Darwin => Os::Macos,
OperatingSystem::Ios => Os::Ios,
OperatingSystem::Netbsd => Os::NetBsd,
OperatingSystem::Freebsd => Os::FreeBsd,
OperatingSystem::Openbsd => Os::OpenBsd,
Expand Down Expand Up @@ -358,6 +362,7 @@ impl Target {
Os::Windows => "windows",
Os::Linux => "linux",
Os::Macos => "darwin",
Os::Ios => "darwin",
Os::FreeBsd => "freebsd",
Os::NetBsd => "netbsd",
Os::OpenBsd => "openbsd",
Expand Down Expand Up @@ -440,6 +445,7 @@ impl Target {
Os::Windows => false,
Os::Linux
| Os::Macos
| Os::Ios
| Os::FreeBsd
| Os::NetBsd
| Os::OpenBsd
Expand Down

0 comments on commit c83075b

Please sign in to comment.