If you like this project or other works of mine, please consider donating to or sponsoring me on Github ❤️
This repo contains code for your build.zig
that can statically compile libgit2, you will be able to include libgit2's header with:
const c = @cImport({
@cInclude("git2.h");
});
In order to statically link libgit2 into your application:
const libgit2 = @import("path/to/libgit2.zig");
pub fn build(b: *std.build.Builder) void {
// ...
const lib = libgit2.create(b, target, mode);
const exe = b.addExecutable("my-program", "src/main.zig");
lib.link(exe);
}