diff --git a/Cargo.toml b/Cargo.toml index bb86e27e..d8d96842 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,7 +59,7 @@ objc_id = "0.1.1" [target.'cfg(not(target_os = "macos"))'.dependencies] ureq = "2.4.0" -[target.'cfg(target_os = "linux")'.dependencies] +[target.'cfg(any(target_os = "linux", target_os = "android" ))'.dependencies] freedesktop_entry_parser = "1.1" lexical-core = "0.7.6" diff --git a/src/android/ndk.rs b/src/android/ndk.rs index be9c4fc7..5ed89a20 100644 --- a/src/android/ndk.rs +++ b/src/android/ndk.rs @@ -25,7 +25,7 @@ pub fn host_tag() -> &'static str { "darwin-x86_64" } -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android" ))] pub fn host_tag() -> &'static str { "linux-x86_64" } diff --git a/src/os/linux/mod.rs b/src/os/linux/mod.rs index f9fdfcc8..082dd957 100644 --- a/src/os/linux/mod.rs +++ b/src/os/linux/mod.rs @@ -165,7 +165,7 @@ pub fn open_file_with( // We use "sh" in order to access "command -v", as that is a bultin command on sh. // Linux does not require a binary "command" in path, so this seems the way to go. -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android"))] pub fn command_path(name: &str) -> bossy::Result { bossy::Command::impure("sh") .with_args(&["-c", &format!("command -v {}", name)]) diff --git a/src/os/mod.rs b/src/os/mod.rs index 244f60bf..0435f926 100644 --- a/src/os/mod.rs +++ b/src/os/mod.rs @@ -6,10 +6,10 @@ mod macos; #[cfg(target_os = "macos")] pub use self::macos::*; -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android"))] mod linux; -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android"))] pub use self::linux::*; #[cfg(windows)] @@ -18,7 +18,7 @@ mod windows; #[cfg(windows)] pub use self::windows::*; -#[cfg(not(any(target_os = "macos", target_os = "linux", windows)))] +#[cfg(not(any(target_os = "macos", target_os = "android", target_os = "linux", windows)))] compile_error!("Host platform not yet supported by cargo-mobile! We'd love if you made a PR to add support for this platform ❤️"); // TODO: we should probably expose common functionality throughout `os` in a