update build to use new build API

This commit is contained in:
avokadoen
2023-02-07 21:51:46 +01:00
parent 782d75ac4c
commit b09e14a649
4 changed files with 21 additions and 17 deletions

View File

@@ -37,10 +37,10 @@ pub fn build(b: *Builder) void {
const gen = vkgen.VkGenerateStep.create(b, "path/to/vk.xml", "vk.zig");
// Add the generated file as package to the final executable
exe.addPackage(gen.getPackage("vulkan"));
exe.addModule("vulkan", gen.getModule());
}
```
This reads vk.xml, parses its contents, and renders the Vulkan bindings to "vk.zig", which is then formatted and placed in `zig-cache`. The resulting file can then be added to an executable by using `addPackage`, after which the bindings will be made available to the executable under the name passed to `getPackage`.
This reads vk.xml, parses its contents, and renders the Vulkan bindings to "vk.zig", which is then formatted and placed in `zig-cache`. The resulting file can then be added to an executable by using `addModule`, after which the bindings will be made available to the executable under the name passed to `getModule`.
### Function & field renaming
Functions and fields are renamed to be more or less in line with [Zig's standard library style](https://ziglang.org/documentation/master/#Style-Guide):