From 15d818928ed8bc953237808f20adc763d915db49 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sat, 12 Jan 2019 13:54:09 +0000 Subject: Check the USE_SYSTEM_LIBNITROKEY environment variable This patch introduces the USE_SYSTEM_LIBNITROKEY environment variable. If it is set when compiling, the nitrokey-sys crate will not try to build libnitrokey from source but instead uses the system libnitrokey version. --- build.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'build.rs') diff --git a/build.rs b/build.rs index af64a69..defce72 100644 --- a/build.rs +++ b/build.rs @@ -54,6 +54,11 @@ fn prepare_version_source( } fn main() { + if env::var("USE_SYSTEM_LIBNITROKEY").is_ok() { + println!("cargo:rustc-link-lib=nitrokey"); + return; + } + let out_dir = env::var("OUT_DIR").expect("Environment variable OUT_DIR is not set"); let out_path = path::PathBuf::from(out_dir); -- cgit v1.2.1