-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
20 lines (16 loc) · 765 Bytes
/
Copy pathbuild.rs
File metadata and controls
20 lines (16 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
extern crate bindgen;
fn main() {
println!("cargo:rustc-link-lib={}={}", "static", "xed");
// println!("cargo:rustc-link-lib={}={}", "static", "xed-ild");
println!("cargo:rustc-link-search={}={}", "native", "xed-c");
// try with: https://github.com/rust-lang/rust/issues/27142
// println!("cargo:rustc-codegen={}={}", "relocation-model", "static");
let bindings = bindgen::Builder::default()
.header("xed-c/include/xed/xed-interface.h")
.prepend_enum_name(false)
.generate()
.expect("Could not generate bindings for xed!");
let outpath = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
bindings.write_to_file(outpath.join("bindings.rs"))
.expect("Couldn't write bindings!");
}