-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.rs
37 lines (32 loc) · 1.36 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
fn main() {
println!("cargo:rustc-link-lib=mujoco");
println!("cargo:rerun-if-changed=src/wrappers/mujoco_wrapper.h");
let bindings = bindgen::Builder::default()
.header("src/wrappers/mujoco_wrapper.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.derive_default(true)
.allowlist_function("mj.*")
.allowlist_type("mj.*")
.allowlist_var("mj.*")
.generate()
.expect("Unable to generate mujoco bindings");
let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("mujoco-bindings.rs"))
.expect("Couldn't write mujoco bindings!");
println!("cargo:rustc-link-lib=ta_lib");
println!("cargo:rerun-if-changed=src/wrappers/talib_wrapper.h");
let bindings = bindgen::Builder::default()
.header("src/wrappers/talib_wrapper.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.derive_default(true)
.allowlist_function("TA.*")
.allowlist_type("TA.*")
.allowlist_var("TA.*")
.generate()
.expect("Unable to generate talib bindings");
let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("talib-bindings.rs"))
.expect("Couldn't write talib bindings!");
}