This should work on linux and windows now

This commit is contained in:
Amédée d'Aboville
2020-01-27 14:54:20 -05:00
parent a177d1d6ee
commit 95c52f1bfa
+8
View File
@@ -1,14 +1,22 @@
extern crate bindgen;
use std::env;
use std::env::consts;
use std::path::PathBuf;
fn main() {
println!("cargo:rustc-link-lib=k4a");
println!("cargo:rerun-if-changed=wrapper.h");
if cfg!(target_os = "linux") {
println!("cargo:rustc-link-search=./vendor/lib/linux");
}
if cfg!(target_os = "windows") {
println!("cargo:rustc-link-search=./vendor/lib/windows/{}", consts::ARCH);
}
let bindings = bindgen::Builder::default()
.header("wrapper.h")
.clang_arg(format!("-I./vendor/include/{}", consts::OS))
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.generate()
.expect("Unable to generate bindings");