-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
41 lines (36 loc) · 1.56 KB
/
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
extern crate bindgen;
use std::env;
use std::path::PathBuf;
fn main() {
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
println!("cargo:rustc-link-lib=apr-1");
println!("cargo:rerun-if-changed=apache2_headers.h");
let apache2_bindings = bindgen::Builder::default()
.header("apache2_headers.h")
.clang_arg("-I/usr/include/apr-1.0")
.clang_arg("-I/usr/include/apache2")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.generate()
.expect("Unable to generate bindings for apache2");
apache2_bindings
.write_to_file(out_path.join("apache2_bindings.rs"))
.expect("Could not write bindings for apache2");
println!("cargo:rerun-if-changed=renderd_protocol.h");
let renderd_protocol_bindings = bindgen::Builder::default()
.header("renderd_protocol.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.generate()
.expect("Unable to generate bindings for renderd protocol");
renderd_protocol_bindings
.write_to_file(out_path.join("renderd_protocol_bindings.rs"))
.expect("Could not write bindings for renderd protocol");
println!("cargo:rerun-if-changed=metatile.h");
let metatile_bindings = bindgen::Builder::default()
.header("metatile.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.generate()
.expect("Unable to generate bindings for metatile");
metatile_bindings
.write_to_file(out_path.join("metatile_bindings.rs"))
.expect("Could not write bindings for metatile");
}