From cff170e80c0d6e2f3650b6838d1b035811744a1d Mon Sep 17 00:00:00 2001 From: Joey Yandle Date: Thu, 9 Feb 2023 17:25:03 -0500 Subject: [PATCH] move bindings.rs into target (#19) * move bindings.rs into target * fmt fixes --- build.rs | 3 ++- src/lib.rs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 4eeae5a..1de43df 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,5 @@ use std::collections::HashSet; +use std::env; use std::iter::FromIterator; use itertools::Itertools; @@ -49,7 +50,7 @@ fn main() { // Unwrap the Result and panic on failure. .expect("Unable to generate bindings"); - let bindings_file = "src/bindings.rs"; + let bindings_file = &format!("{}/bindings.rs", env::var("OUT_DIR").unwrap()); // Write the bindings to the $OUT_DIR/bindings.rs file. bindings diff --git a/src/lib.rs b/src/lib.rs index b4a06b5..d86c2fb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,9 @@ #[allow(deref_nullptr)] #[allow(improper_ctypes)] #[allow(clippy::all)] -mod bindings; +mod bindings { + include!(concat!(env!("OUT_DIR"), "/bindings.rs")); +} pub mod point; pub mod scalar;