Skip to content

Commit

Permalink
no --bindgen needed
Browse files Browse the repository at this point in the history
  • Loading branch information
lattice0 authored and bbqsrc committed May 24, 2022
1 parent 32bc435 commit 62a17cf
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,22 @@ pub(crate) fn run(
.env(cargo_env_target_cfg(triple, "linker"), &target_linker)
.args(cargo_args);

let extra_include = format!("{}/{}", &target_sysroot.display(), triple);
if bindgen {
let extra_include = format!("{}/{}", &target_sysroot.display(), triple);
let extra_bindgen_args = format!(
let bindgen_args = format!(
"--sysroot={} -I{}",
&target_sysroot.display(),
extra_include
);
cargo_cmd.env(bindgen_clang_args_key, extra_bindgen_args.clone());
log::debug!("extra_bindgen_args={}", extra_bindgen_args);
cargo_cmd.env(bindgen_clang_args_key, bindgen_args.clone());
log::debug!("bindgen_args={}", bindgen_args);
} else {
let bindgen_args = format!(
"-I{}",
extra_include
);
cargo_cmd.env(bindgen_clang_args_key, bindgen_args.clone());
log::debug!("bindgen_args={}", bindgen_args);
}

match dir.parent() {
Expand Down

0 comments on commit 62a17cf

Please sign in to comment.