From 4d324063c52684348c5d1821cafd104cb9073dec Mon Sep 17 00:00:00 2001 From: SoLongAndThanksForAllThePizza <103753680+SoLongAndThanksForAllThePizza@users.noreply.github.com> Date: Wed, 25 May 2022 20:23:02 +0800 Subject: [PATCH] add flutter feature and rename mobile to flutter --- Cargo.toml | 6 ++++-- src/{mobile.rs => flutter.rs} | 0 src/{mobile_ffi.rs => flutter_ffi.rs} | 0 src/lib.rs | 10 +++++----- 4 files changed, 9 insertions(+), 7 deletions(-) rename src/{mobile.rs => flutter.rs} (100%) rename src/{mobile_ffi.rs => flutter_ffi.rs} (100%) diff --git a/Cargo.toml b/Cargo.toml index a3e2a66e1..2b707a688 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,8 @@ cli = [] use_samplerate = ["samplerate"] use_rubato = ["rubato"] use_dasp = ["dasp"] -default = ["use_dasp"] +flutter = ["flutter_rust_bridge"] +default = ["use_dasp","flutter"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -52,6 +53,7 @@ rpassword = "6.0" base64 = "0.13" sysinfo = "0.23" num_cpus = "1.13" +flutter_rust_bridge = { version = "1.30.0", optional = true } [target.'cfg(not(target_os = "linux"))'.dependencies] reqwest = { version = "0.11", features = ["json", "rustls-tls"], default-features=false } @@ -99,7 +101,7 @@ async-process = "1.3" android_logger = "0.11" jni = "0.19.0" -[target.'cfg(any(target_os = "android", target_os = "ios", target_os = "linux"))'.dependencies] +[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies] flutter_rust_bridge = "1.30.0" [workspace] diff --git a/src/mobile.rs b/src/flutter.rs similarity index 100% rename from src/mobile.rs rename to src/flutter.rs diff --git a/src/mobile_ffi.rs b/src/flutter_ffi.rs similarity index 100% rename from src/mobile_ffi.rs rename to src/flutter_ffi.rs diff --git a/src/lib.rs b/src/lib.rs index 556d22594..84d9af8e1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,12 +21,12 @@ pub mod ipc; pub mod ui; mod version; pub use version::*; -// #[cfg(any(target_os = "android", target_os = "ios"))] +#[cfg(any(target_os = "android", target_os = "ios", feature = "flutter"))] mod bridge_generated; -// #[cfg(any(target_os = "android", target_os = "ios"))] -pub mod mobile; -// #[cfg(any(target_os = "android", target_os = "ios"))] -pub mod mobile_ffi; +#[cfg(any(target_os = "android", target_os = "ios", feature = "flutter"))] +pub mod flutter; +#[cfg(any(target_os = "android", target_os = "ios", feature = "flutter"))] +pub mod flutter_ffi; use common::*; #[cfg(feature = "cli")] pub mod cli;