-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
39 lines (34 loc) · 1.5 KB
/
build.rs
File metadata and controls
39 lines (34 loc) · 1.5 KB
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
extern crate bindgen;
use std::env;
use std::path::PathBuf;
fn main() {
println!("cargo:rustc-link-lib=static=hell");
println!("cargo:rustc-link-lib=dylib=winmm");
println!("cargo:rustc-link-lib=dylib=secur32");
println!("cargo:rustc-link-lib=dylib=dmoguids");
println!("cargo:rustc-link-lib=dylib=wmcodecdspuuid");
println!("cargo:rustc-link-lib=dylib=amstrmid");
println!("cargo:rustc-link-lib=dylib=msdmo");
println!("cargo:rustc-link-lib=dylib=gdi32");
println!("cargo:rustc-link-lib=dylib=d3d11");
println!("cargo:rustc-link-lib=dylib=dxgi");
println!("cargo:rerun-if-changed=include/hell.hpp");
let bindings = bindgen::Builder::default()
.header("include/hell.hpp")
.clang_arg("--include-directory=include")
.clang_arg("--include-directory=include/third_party/abseil-cpp")
.clang_arg("--include-directory=include/third_party/googletest/src/googletest/include")
.clang_arg("--include-directory=include/third_party/googletest/src/googlemock/include")
.clang_arg("-DWEBRTC_WIN")
.clang_arg("-DNOMINMAX")
.clang_arg("-DWEBRTC_USE_BUILTIN_ISAC_FLOAT")
.clang_arg("--")
.clang_arg("-std=c++11")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.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!");
}