diff --git a/src/cross_compile.rs b/src/cross_compile.rs index 20546ff19..5567bf3b7 100644 --- a/src/cross_compile.rs +++ b/src/cross_compile.rs @@ -9,6 +9,7 @@ use std::path::{Path, PathBuf}; pub fn is_cross_compiling(target: &Target) -> Result { let target_triple = target.target_triple(); let host = target.host_triple(); + if target_triple == host { // Not cross-compiling return Ok(false); diff --git a/src/target.rs b/src/target.rs index fbb935312..c57ef3a96 100644 --- a/src/target.rs +++ b/src/target.rs @@ -21,6 +21,7 @@ pub enum Os { Linux, Windows, Macos, + Ios, FreeBsd, NetBsd, OpenBsd, @@ -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"), @@ -149,6 +151,7 @@ fn get_supported_architectures(os: &Os) -> Vec { ], 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, @@ -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, @@ -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", @@ -440,6 +445,7 @@ impl Target { Os::Windows => false, Os::Linux | Os::Macos + | Os::Ios | Os::FreeBsd | Os::NetBsd | Os::OpenBsd