No description
|
Some checks failed
ci / build (Debug, aarch64-linux-gnu) (push) Successful in 45s
ci / build (Debug, aarch64-linux-musl) (push) Successful in 45s
ci / build (Debug, aarch64-macos) (push) Failing after 1m23s
ci / build (Debug, riscv64-linux-musl) (push) Successful in 1m38s
ci / build (Debug, riscv64-linux-gnu) (push) Successful in 1m40s
ci / build (Debug, x86_64-linux-gnu) (push) Successful in 1m38s
ci / build (Debug, x86_64-linux-musl) (push) Successful in 2m25s
ci / build (Debug, x86_64-windows-gnu) (push) Successful in 2m21s
ci / build (Debug, x86_64-macos) (push) Failing after 2m23s
ci / build (ReleaseFast, aarch64-linux-musl) (push) Successful in 2m17s
ci / build (ReleaseFast, aarch64-linux-gnu) (push) Successful in 2m20s
ci / build (ReleaseFast, aarch64-macos) (push) Failing after 2m17s
ci / build (ReleaseFast, riscv64-linux-gnu) (push) Successful in 1m17s
ci / build (ReleaseFast, x86_64-linux-gnu) (push) Successful in 1m6s
ci / build (ReleaseFast, riscv64-linux-musl) (push) Successful in 1m16s
ci / build (ReleaseFast, x86_64-linux-musl) (push) Successful in 1m6s
ci / build (ReleaseSafe, aarch64-linux-gnu) (push) Successful in 50s
ci / build (ReleaseFast, x86_64-macos) (push) Failing after 55s
ci / build (ReleaseSafe, aarch64-linux-musl) (push) Successful in 49s
ci / build (ReleaseFast, x86_64-windows-gnu) (push) Successful in 59s
ci / build (ReleaseSafe, aarch64-macos) (push) Failing after 1m19s
ci / build (ReleaseSafe, riscv64-linux-gnu) (push) Successful in 1m29s
ci / build (ReleaseSafe, riscv64-linux-musl) (push) Successful in 1m25s
ci / build (ReleaseSafe, x86_64-windows-gnu) (push) Failing after 38s
ci / build (ReleaseSafe, x86_64-macos) (push) Failing after 1m54s
ci / build (ReleaseSafe, x86_64-linux-musl) (push) Successful in 1m55s
ci / build (ReleaseSafe, x86_64-linux-gnu) (push) Successful in 1m58s
ci / build (ReleaseSmall, aarch64-linux-gnu) (push) Successful in 1m23s
ci / build (ReleaseSmall, aarch64-macos) (push) Failing after 1m30s
ci / build (ReleaseSmall, aarch64-linux-musl) (push) Successful in 1m33s
ci / build (ReleaseSmall, riscv64-linux-gnu) (push) Successful in 1m12s
ci / build (ReleaseSmall, riscv64-linux-musl) (push) Successful in 1m10s
ci / build (ReleaseSmall, x86_64-linux-gnu) (push) Successful in 1m12s
ci / build (ReleaseSmall, x86_64-linux-musl) (push) Successful in 1m14s
ci / build (ReleaseSmall, x86_64-macos) (push) Failing after 50s
ci / test (Debug, ubuntu-latest) (push) Failing after 46s
ci / build (ReleaseSmall, x86_64-windows-gnu) (push) Successful in 46s
ci / test (ReleaseFast, ubuntu-latest) (push) Failing after 39s
ci / test (ReleaseSafe, ubuntu-latest) (push) Failing after 36s
ci / test (ReleaseSmall, ubuntu-latest) (push) Failing after 38s
|
||
|---|---|---|
| .github/workflows | ||
| src | ||
| zlib@cacf7f1d4e | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| build.zig | ||
| build.zig.zon | ||
| liblist.sh | ||
| LICENSE | ||
| README.md | ||
zlib build package
How to use
This repo contains code for your build.zig that can statically compile zlib, as well as some idiomatic Zig bindings for zlib that you can use in your application. In either case below you will be able to include zlibs header with:
const c = @cImport({
@cInclude("zlib.h");
});
Link and add bindings to your application
In order to statically link zlib into your application and access the bindings with a configurable import string:
const zlib = @import("path/to/zlib.zig");
pub fn build(b: *std.build.Builder) void {
// ...
const lib = zlib.create(b, target, mode);
const exe = b.addExecutable("my-program", "src/main.zig");
lib.link(exe, .{ .import_name = "zlib" });
}
Now code that is part of the my-program executable can import the zlib bindings with @import("zlib").
Only link to your application
In order to just link to the application, all you need to do is omit the .import_name = "zlib" argument to zlib's link options:
lib.link(exe, .{});