From 95c52f1bfaacf2900a601d6a15cc8e2deda6b8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Am=C3=A9d=C3=A9e=20d=27Aboville?= Date: Mon, 27 Jan 2020 14:54:20 -0500 Subject: [PATCH] This should work on linux and windows now --- build.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.rs b/build.rs index 4d86798..ff6be43 100644 --- a/build.rs +++ b/build.rs @@ -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");