diff --git a/build.rs b/build.rs index 860ebae77..5ed40b001 100644 --- a/build.rs +++ b/build.rs @@ -77,6 +77,17 @@ fn install_oboe() { } fn gen_flutter_rust_bridge() { + // Get dependent of flutter + println!("cargo:rerun-if-changed=flutter/pubspec.lock"); + println!("cargo:rerun-if-changed=flutter/pubspec.yaml"); + if !std::path::Path::new("./flutter/.packages").exists(){ + std::process::Command::new("flutter") + .args(["pub", "get"]) + .current_dir("./flutter") + .output() + .expect("failed to execute flutter pub get"); + }; + let llvm_path = match std::env::var("LLVM_HOME") { Ok(path) => Some(vec![path]), Err(_) => None,