-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.rs
24 lines (22 loc) · 848 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
fn main() {
println!("cargo:rerun-if-changed=includes/mrcp.h");
println!("cargo:rustc-link-lib=apr-1");
println!("cargo:rustc-link-lib=unimrcpserver");
println!("cargo:rustc-link-search=/opt/unimrcp/lib");
let mut builder = bindgen::Builder::default();
builder = builder
.header("includes/mrcp.h")
.clang_arg("-I/opt/unimrcp/include")
.clang_arg("-I/opt/unimrcp/include/apr-1");
let bindings = builder
.constified_enum_module("*")
.prepend_enum_name(false)
.blocklist_item("FALSE")
.derive_eq(true)
.generate()
.expect("Unable to generate bindings.");
let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Unable to write bindings.");
}