paveloom-z/zig-gtk4
Zig bindings for the `gtk4` library
Repository:
Make sure you have installed:
gtk4
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-gtk4
Make sure you have added the dependencies in your build script:
// <...>
const deps = @import("deps.zig");
const gtk4_pkg = deps.pkgs.gtk4.pkg.?;
// <...>
pub fn build(b: *std.build.Builder) !void {
// <...>
// For each step
inline for (steps) |step| {
// Add the library package
step.addPackage(gtk4_pkg);
// Link the libraries
step.linkLibC();
step.linkSystemLibrary("gtk4");
// Use the `stage1` compiler
step.use_stage1 = true;
}
// <...>
}