/zig-libgit2

compile libgit2 in your build.zig

Primary LanguageZigMIT LicenseMIT

libgit2 build package

ci

Like this project?

If you like this project or other works of mine, please consider donating to or sponsoring me on Github ❤️

How to use

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");
});

Link to your application

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);
}