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