Fail directly if TARGET were missing

This commit is contained in:
Nicolas Stalder
2021-01-06 12:19:35 +01:00
parent 528616927a
commit 711b3067da
+4 -2
View File
@@ -1,9 +1,9 @@
use std::env;
use std::path::PathBuf;
fn main() {
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut builder = cc::Build::new();
let target = env::var("TARGET").unwrap_or("".to_string());
let target = env::var("TARGET")?;
let builder = builder
.flag("-std=c11")
.flag("-DLFS_NO_MALLOC")
@@ -36,4 +36,6 @@ fn main() {
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
Ok(())
}