From a054c7a657d77c3d30d6e31c2cabd746bb3c4993 Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Fri, 30 Jul 2021 00:49:46 +0200 Subject: [PATCH] Update readme with new build.zig usage --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 729e7b2..2cd1690 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,9 @@ pub fn build(b: *Builder) void { // Create a step that generates vk.zig (stored in zig-cache) from the provided vulkan registry. const gen = vkgen.VkGenerateStep.init(b, "path/to/vk.xml", "vk.zig"); - exe.step.dependOn(&gen.step); // Add the generated file as package to the final executable - exe.addPackagePath("vulkan", gen.full_out_path); + exe.addPackagePath(gen.package); } ``` 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 `addPackagePath`. @@ -230,8 +229,7 @@ pub fn build(b: *Builder) void { const exe = b.addExecutable("my-executable", "src/main.zig"); const gen = vkgen.VkGenerateStep(b, "path/to/vk.xml", "vk.zig"); - exe.step.dependOn(&gen.step); - exe.addPackagePath("vulkan", gen.full_out_path); + exe.addPackagePath(gen.package); const shader_comp = vkgen.ShaderCompileStep.init( builder,