From 9b177b1b026e9ee824be74fd25a683205b50e0da Mon Sep 17 00:00:00 2001 From: Ian Johnson Date: Wed, 31 Jan 2024 01:47:55 -0500 Subject: [PATCH] docs: update usage instructions --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 09297d0..77d94b7 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,17 @@ introspection data. ## Usage -To use the bindings, add the `bindings` branch of this repository to -`build.zig.zon` and use the `addBindingModule` function exposed by `build.zig`: +To use the bindings, find the [latest release of this +project](https://github.com/ianprime0509/zig-gobject/releases) and add the +desired bindings artifact as a dependency in `build.zig.zon`. Then, the exposed +bindings can be used as modules. For example: ```zig -// exe is the compilation step for your applicaton -exe.addModule("gtk", zig_gobject.addBindingModule(b, exe, "gtk-4.0")); +const gobject = b.dependency("gobject", .{}); +exe.root_module.addImport("gtk", gobject.module("gtk-4.0")); +exe.root_module.addImport("adw", gobject.module("adw-1")); ``` -There are examples of this pattern in the `examples` and `test` subprojects. - ## Examples There are several examples in the `examples` directory, which is itself a