diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2018-05-19 19:09:42 +0000 |
---|---|---|
committer | Robin Krahl <me@robin-krahl.de> | 2018-05-19 21:10:43 +0200 |
commit | a8517d9707e5ef313d6f4d69b51d21251c82ea91 (patch) | |
tree | 6769c8a1bfcdd2e0abcafdc95e8940f9212208ae /nitrokey-sys/build.rs | |
download | nitrokey-rs-a8517d9707e5ef313d6f4d69b51d21251c82ea91.tar.gz nitrokey-rs-a8517d9707e5ef313d6f4d69b51d21251c82ea91.tar.bz2 |
Initial commit
Diffstat (limited to 'nitrokey-sys/build.rs')
-rw-r--r-- | nitrokey-sys/build.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/nitrokey-sys/build.rs b/nitrokey-sys/build.rs new file mode 100644 index 0000000..7b3325c --- /dev/null +++ b/nitrokey-sys/build.rs @@ -0,0 +1,17 @@ +extern crate bindgen; + +use std::env; +use std::path::PathBuf; + +fn main() { + println!("cargo:rustc-link-lib=nitrokey"); + + let bindings = bindgen::Builder::default() + .header("wrapper.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"); +} |