#using packages in build.zig

1 messages · Page 1 of 1 (latest)

livid bridge
#

How would I use a package in my build.zig, say zig-osdev/disk-image-step, using the zig package manager? Or is the only way to do it here as a git submodule? Thanks!

quasi tiger
#

the usual first step to adding a remote (or local) dependency is to add it to your zon file, you can use zig fetch --save https://github.com/zig-osdev/disk-image-step/archive/81c523cf1c83ffa3c55dd4d902b57aa042d2697c.tar.gz for disk-image-step. if you wanna access its build.zig in your build.zig you just gotta do const dis = @import("disk-image-step") since "disk-image-step" should be it's name in your zon file (EDITED: it only works with .tar.gz links)