Repository:
Make sure you have installed:
- A development library for
libuv
- Zig (
v0.10.1
)
To build and install the library, run zig build install
.
To run unit tests, run zig build test
.
See zig build --help
for more build options, including how to run examples.
To integrate the bindings into your project:
-
Add this repository as a dependency in
zigmod.yml
:# <...> root_dependencies: - src: git https://github.com/paveloom-z/zig-libuv
-
Make sure you have added the dependencies in your build script:
// <...> const deps = @import("deps.zig"); const uv_pkg = deps.pkgs.uv.pkg.?; // <...> pub fn build(b: *std.build.Builder) !void { // <...> // For each step inline for (steps) |step| { // Add the library package step.addPackage(uv_pkg); // Link the libraries step.linkLibC(); step.linkSystemLibrary("libuv"); // Use the `stage1` compiler because of // https://github.com/ziglang/zig/issues/12325 step.use_stage1 = true; } // <...> }
If you'd like a static build, take a look at the stab in the
zigmod.yml
file.