Skip to content

mattnite/zig-libgit2

Repository files navigation

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

About

compile libgit2 in your build.zig

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published