2 use std::path::PathBuf;
5 let bindings = bindgen::Builder::default()
6 .blocklist_function("qgcvt")
7 .blocklist_function("qgcvt_r")
8 .blocklist_function("qfcvt")
9 .blocklist_function("qfcvt_r")
10 .blocklist_function("qecvt")
11 .blocklist_function("qecvt_r")
12 .blocklist_function("strtold")
13 .clang_arg("-Dbool=int")
14 .generate_comments(false)
15 .clang_arg("-I../../lib/talloc")
16 .header("../../lib/util/talloc_stack.h")
17 .parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
19 .expect("Unable to generate bindings");
20 println!("cargo:rerun-if-changed=../../lib/util/talloc_stack.h");
22 let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
24 .write_to_file(out_path.join("bindings.rs"))
25 .expect("Couldn't write bindings!");
27 let mut src_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
28 src_dir.push("../../bin/default/lib/talloc");
29 if config::USING_SYSTEM_TALLOC == 1 {
30 println!("cargo:rustc-link-lib=talloc");
32 println!("cargo:rustc-link-lib=talloc-private-samba");
35 "cargo:rustc-link-search=native={}",
36 src_dir.to_str().unwrap()