mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-10 18:06:01 +02:00
use new event channel for mobile and web
This commit is contained in:
parent
85a2a7cd44
commit
a7af7967f6
26 changed files with 1875 additions and 480 deletions
17
build.rs
17
build.rs
|
@ -62,12 +62,29 @@ fn install_oboe() {
|
|||
//cc::Build::new().file("oboe.cc").include(include).compile("oboe_wrapper");
|
||||
}
|
||||
|
||||
fn gen_flutter_rust_bridge() {
|
||||
// Tell Cargo that if the given file changes, to rerun this build script.
|
||||
println!("cargo:rerun-if-changed=src/mobile_ffi.rs");
|
||||
// settings for fbr_codegen
|
||||
let opts = lib_flutter_rust_bridge_codegen::Opts {
|
||||
// Path of input Rust code
|
||||
rust_input: "src/mobile_ffi.rs".to_string(),
|
||||
// Path of output generated Dart code
|
||||
dart_output: "flutter/lib/generated_bridge.dart".to_string(),
|
||||
// for other options lets use default
|
||||
..Default::default()
|
||||
};
|
||||
// run fbr_codegen
|
||||
lib_flutter_rust_bridge_codegen::frb_codegen(opts).unwrap();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
hbb_common::gen_version();
|
||||
install_oboe();
|
||||
// there is problem with cfg(target_os) in build.rs, so use our workaround
|
||||
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
|
||||
if target_os == "android" || target_os == "ios" {
|
||||
gen_flutter_rust_bridge();
|
||||
return;
|
||||
}
|
||||
#[cfg(all(windows, feature = "inline"))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue