[niepce] rust: fix build.rs if CARGO_TARGET_DIR is unknown
- From: Hubert Figuière <hub src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [niepce] rust: fix build.rs if CARGO_TARGET_DIR is unknown
- Date: Tue, 20 Feb 2018 04:51:53 +0000 (UTC)
commit b7bea0214855c03950b411688c92747ab064dbcd
Author: Hubert Figuière <hub figuiere net>
Date: Sat Feb 17 23:11:55 2018 -0500
rust: fix build.rs if CARGO_TARGET_DIR is unknown
build.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/build.rs b/build.rs
index b8a4887..cec2063 100644
--- a/build.rs
+++ b/build.rs
@@ -49,7 +49,7 @@ fn main() {
// Use cbindgen to generate C bindings.
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
- let target_dir = env::var("CARGO_TARGET_DIR").unwrap();
+ let target_dir = env::var("CARGO_TARGET_DIR").unwrap_or(String::from("./target"));
let mut target_file = PathBuf::from(target_dir);
target_file.push("bindings.h");
cbindgen::generate(&crate_dir)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]