-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.rs
31 lines (27 loc) · 899 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
27
28
29
30
31
extern crate bindgen;
extern crate cc;
use std::path::PathBuf;
fn main() {
let bindings = bindgen::Builder::default()
.clang_arg("-std=c++11")
.clang_arg("-Ivendor/ChromaSDK/inc")
.enable_cxx_namespaces()
.header("src/lib.hpp")
.whitelist_recursively(true)
.whitelist_function("Load")
.whitelist_function("ChromaSDK.+")
.whitelist_var("ERROR_.+")
.whitelist_var("ChromaSDK.+")
.whitelist_type("ChromaSDK.+")
.generate()
.expect("unable to generate bindings");
cc::Build::new()
.include("vendor/ChromaSDK/inc")
.file("src/lib.cpp")
.flag("-std=c++11")
.compile("steam");
let out_path = PathBuf::from(std::env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("unable to write bindings");
}