From f424891511b79e2ec1fb8e1dcb407228da693316 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 20 May 2018 10:59:41 +0000 Subject: Replace generated with static code Use bindgen to generate the bindings statically instead of during build. Code generation is not necessary as NK_C_API.h does not contain any system-dependent definitions. Removing bindgen as a build dependency also drastically speeds up compilation. --- build.rs | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'build.rs') diff --git a/build.rs b/build.rs index 470cb96..7791134 100644 --- a/build.rs +++ b/build.rs @@ -1,17 +1,3 @@ -extern crate bindgen; - -use std::env; -use std::path::PathBuf; - fn main() { println!("cargo:rustc-link-lib=nitrokey"); - - let bindings = bindgen::Builder::default() - .header("libnitrokey-3.3/NK_C_API.h") - .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("Could not write bindings"); } -- cgit v1.2.1