-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.rs
39 lines (34 loc) · 1.37 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
use std::env;
use std::path::PathBuf;
fn main() {
#[cfg(feature = "with_r3e")] {
println!("cargo:rerun-if-changed=src/raceroom_racing_experience/r3e.h");
let bindings = bindgen::Builder::default()
.header("src/raceroom_racing_experience/r3e.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.derive_partialeq(true)
.derive_eq(true)
.derive_hash(true)
.generate()
.expect("Unable to generate bindings");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("r3e.rs"))
.expect("Couldn't write bindings!");
}
#[cfg(feature = "with_truck_simulator")] {
let bindings = bindgen::Builder::default()
.header("src/truck_simulator/scs-sdk-plugin/scssdk.h")
.header("src/truck_simulator/scs-sdk-plugin/scs-telemetry-common.hpp")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.derive_partialeq(true)
.derive_eq(true)
.derive_hash(true)
.generate()
.expect("Unable to generate bindings");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("scs_telemetry_common.rs"))
.expect("Couldn't write bindings!");
}
}