commit 8681ab734ad6a03367f64bba3726d73258a83cd8
parent dca78a48207e7159669113808c41d2c7f855c78d
Author: William Casarin <jb55@jb55.com>
Date: Thu, 14 Dec 2023 18:49:11 -0800
rust: output bindings to build dir
otherwise cargo complains when publishing
Diffstat:
4 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -25,8 +25,6 @@ deps/
testdata/db/*.mdb
ndb
-rust/src/bindings.rs
-
# Added by cargo
/target
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
@@ -6,7 +6,7 @@ readme = "README.md"
version = "0.1.0"
edition = "2021"
build = "build.rs"
-include = ["../deps", "src", "Cargo.toml", "../*.c", "../*.h"]
+include = ["../deps", "src", "Cargo.toml", "build.rs", "../*.c", "../*.h"]
[build-dependencies]
bindgen = "0.69.1"
diff --git a/rust/build.rs b/rust/build.rs
@@ -117,6 +117,6 @@ fn main() {
// Write the bindings to the $OUT_DIR/bindings.rs file.
bindings
- .write_to_file("src/bindings.rs")
+ .write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
}
diff --git a/rust/src/bindings.rs b/rust/src/bindings.rs
@@ -0,0 +1 @@
+include!(concat!(env!("OUT_DIR"), "/bindings.rs"));