[PATCH 08/13] rust/gitcore: link with c
From: Ezekiel Newren <ezekielnewren@gmail.com>
Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>
---
Cargo.toml | 1 +
rust/gitcore/Cargo.toml | 6 ++++--
rust/gitcore/build.rs | 7 +++++++
3 files changed, 12 insertions(+), 2 deletions(-)
create mode 100644 rust/gitcore/build.rs
diff --git a/Cargo.toml b/Cargo.toml
index b7b5890934..4585fda0fc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,5 +2,6 @@
members = [
"rust/generate-headers",
"rust/gitcore",
+ "rust/link-with-c",
]
resolver = "2"
diff --git a/rust/gitcore/Cargo.toml b/rust/gitcore/Cargo.toml
index 2f51bf5d5f..fadac77d42 100644
--- a/rust/gitcore/Cargo.toml
+++ b/rust/gitcore/Cargo.toml
@@ -2,9 +2,11 @@
name = "gitcore"
version = "0.1.0"
edition = "2018"
-rust-version = "1.49.0"
[lib]
-crate-type = ["staticlib"]
+crate-type = ["staticlib", "rlib"]
[dependencies]
+
+[build-dependencies]
+link-with-c = { path = "../link-with-c" }
diff --git a/rust/gitcore/build.rs b/rust/gitcore/build.rs
new file mode 100644
index 0000000000..7427a5e45d
--- /dev/null
+++ b/rust/gitcore/build.rs
@@ -0,0 +1,7 @@
+use link_with_c::BuildHelper;
+
+fn main() {
+ BuildHelper::new(std::env::vars().collect())
+ // .generate_header(|_|{})
+ .build();
+}
--
gitgitgadget