zlib ported to the zig build system
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Andrew Kelley 0042c0a6a4 keep the version unreleased in the main branch
only release branches will have versions without "unreleased" in them
2026-10-29 11:31:41 -07:00
.gitignore Update to zlib 1.3.2 2026-04-13 17:00:53 -06:00
build.zig Fix build for Zig 0.16.0-dev.1657+985a3565c 2025-12-24 15:14:31 -07:00
build.zig.zon keep the version unreleased in the main branch 2026-10-29 11:31:41 -07:00
LICENSE add MIT license 2023-10-14 12:31:12 -07:00
README.md readme: update example 2025-08-19 21:44:28 -06:00

zlib

This is zlib, packaged for Zig.

How to use it

First, update your build.zig.zon:

zig fetch --save https://github.com/allyourcodebase/zlib/archive/refs/tags/1.3.1.tar.gz

Next, add this snippet to your build.zig script:

const zlib_dep = b.dependency("zlib", .{
    .target = target,
    .optimize = optimize,
});
your_compilation.linkLibrary(zlib_dep.artifact("z"));

This will provide zlib as a static library to your_compilation.