Skip to content

Commit

Permalink
docs: update usage instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ianprime0509 committed Jan 31, 2024
1 parent 506e889 commit 9b177b1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9b177b1

Please sign in to comment.