fix building with cargo (dont build the bindings file unless ESP32 env variables are present). ready to merge
This commit is contained in:
parent
9d8fccc2e3
commit
90298ad35d
2
build.rs
2
build.rs
|
|
@ -2,10 +2,12 @@ use std::path::{Path, PathBuf};
|
|||
use std::{env, time};
|
||||
|
||||
fn main() {
|
||||
if env::var("CARGO_BUILD_TARGET_DIR").is_ok() {
|
||||
let cargo_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
|
||||
let target_dir = PathBuf::from(env::var("CARGO_BUILD_TARGET_DIR").unwrap());
|
||||
|
||||
run_cbindgen(&cargo_dir, &target_dir);
|
||||
}
|
||||
}
|
||||
|
||||
fn run_cbindgen(cargo_dir: &Path, target_dir: &Path) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue