Check LLVM_HOME when build

This commit is contained in:
Asura 2022-09-02 02:06:40 -07:00
parent a2763c2d6f
commit c3fe407d5c

@ -85,11 +85,17 @@ fn gen_flutter_rust_bridge() {
.output() .output()
.expect("failed to execute flutter pub get"); .expect("failed to execute flutter pub get");
}; };
let llvm_path = match std::env::var("LLVM_HOME") { let llvm_path = match std::env::var("LLVM_HOME") {
Ok(path) => Some(vec![path]), Ok(path) => {
Err(_) => None, if !path.is_empty() {
Some(vec![path])
} else {
panic!("Missing LVM_HOME environment variable");
}
}
Err(_) => panic!("Failure to get environments"),
}; };
// Tell Cargo that if the given file changes, to rerun this build script. // Tell Cargo that if the given file changes, to rerun this build script.
println!("cargo:rerun-if-changed=src/flutter_ffi.rs"); println!("cargo:rerun-if-changed=src/flutter_ffi.rs");
// settings for fbr_codegen // settings for fbr_codegen