-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.rs
26 lines (24 loc) · 902 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
25
26
// vim: tw=80
fn main() {
use std::{env, path::PathBuf};
let bindings = bindgen::Builder::default()
.header("/usr/include/sys/param.h")
.header("/usr/include/sys/mount.h")
.header("/usr/include/sys/time.h")
.header("/usr/include/nfs/nfsproto.h")
.header("/usr/include/nfsclient/nfs.h")
.header("/usr/include/nfsserver/nfs.h")
.header("/usr/include/nfs/nfssvc.h")
.header("/usr/include/fs/nfs/nfsport.h")
.header("/usr/include/unistd.h")
.allowlist_function("nfssvc")
.allowlist_type("nfsstatsv1")
.allowlist_var("NFS.*")
.derive_default(true)
.generate()
.expect("Unable to generate bindings");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
}