diff options
| author | Calvin Wan <calvinwan@google.com> | 2025-01-29 13:50:44 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-01-29 15:06:50 -0800 |
| commit | 65c10aa8d5000e0ecab34a9652056f0520fe51ed (patch) | |
| tree | 20cf8b5a947d7eff531b68a08af0a26691e68916 /contrib/libgit-rs/build.rs | |
| parent | d76eb0dcccb19d2f85924a4be177ae76126bf5d3 (diff) | |
| download | git-65c10aa8d5000e0ecab34a9652056f0520fe51ed.tar.gz | |
libgit: add higher-level libgit crate
The C functions exported by libgit-sys do not provide an idiomatic Rust
interface. To make it easier to use these functions via Rust, add a
higher-level "libgit" crate, that wraps the lower-level configset API
with an interface that is more Rust-y.
This combination of $X and $X-sys crates is a common pattern for FFI in
Rust, as documented in "The Cargo Book" [1].
[1] https://doc.rust-lang.org/cargo/reference/build-scripts.html#-sys-packages
Co-authored-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/libgit-rs/build.rs')
| -rw-r--r-- | contrib/libgit-rs/build.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/libgit-rs/build.rs b/contrib/libgit-rs/build.rs new file mode 100644 index 0000000000..f8bd01a690 --- /dev/null +++ b/contrib/libgit-rs/build.rs @@ -0,0 +1,4 @@ +pub fn main() { + let ac = autocfg::new(); + ac.emit_has_path("std::ffi::c_char"); +} |
