Skip to content

Commit

Permalink
Merge remote-tracking branch 'procdump/target_bindgen'
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsastrix committed Jun 28, 2022
2 parents ea8ac02 + 151c328 commit 29fdaee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libuci-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ fn main() {
}

let mut builder = bindgen::Builder::default();
// if BINDGEN_TARGET is set it instructs the target bindgen is built for
if let Ok(bindgen_target) = env::var("BINDGEN_TARGET") {
builder = builder.clang_arg(format!("--target={}", bindgen_target));
}

// if UCI_DIR is present, use it to look for the header file and precompiled libs
if let Ok(uci_dir) = env::var("UCI_DIR") {
Expand Down
2 changes: 2 additions & 0 deletions libuci-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
//! If building inside the OpenWRT SDK with OpenWRT's UCI package set the environment variable
//! `UCI_DIR=$(STAGING_DIR)/usr` using the corresponding Makefile.
//! rust-uci will automatically use the headers and libraries for the target system.
//! When crosscompiling it may be useful to set BINDGEN_TARGET to instruct what
//! target bindgen is built for.
//!
//! ## Vendored
//!
Expand Down

0 comments on commit 29fdaee

Please sign in to comment.