mirror of
https://github.com/storytold/k4a-sys-temp.git
synced 2026-10-09 00:09:45 +00:00
This should work on linux and windows now
This commit is contained in:
@@ -1,14 +1,22 @@
|
|||||||
extern crate bindgen;
|
extern crate bindgen;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
use std::env::consts;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("cargo:rustc-link-lib=k4a");
|
println!("cargo:rustc-link-lib=k4a");
|
||||||
println!("cargo:rerun-if-changed=wrapper.h");
|
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()
|
let bindings = bindgen::Builder::default()
|
||||||
.header("wrapper.h")
|
.header("wrapper.h")
|
||||||
|
.clang_arg(format!("-I./vendor/include/{}", consts::OS))
|
||||||
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
|
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
|
||||||
.generate()
|
.generate()
|
||||||
.expect("Unable to generate bindings");
|
.expect("Unable to generate bindings");
|
||||||
|
|||||||
Reference in New Issue
Block a user