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;