zig-gamedev / zgpu

Cross-platform graphics lib for Zig built on top of Dawn native WebGPU implementation.
MIT License
4 stars 2 forks source link

Having issues using within zig build system following the README #6

Closed iamcdonald closed 1 week ago

iamcdonald commented 1 week ago

Hi,

first off I just wanted to say I appreciate the work you're doing with these packages.

I'm currently just dipping a toe and following the outline here. However, I'm getting this build error

thread 6001253 panic: no dependency named 'dawn_aarch64_macos' in '.../build.zig.zon'. All packages used in build.zig must be declared in this file

from the line

@import("zgpu").addLibraryPathsTo(exe);

Is the intention that the dawn dependencies should be added to my projects build.zig.zon or am I missing something obvious?

Just for context I'm currently running zig version -> 0.14.0-dev.2034+56996a280

hazeycode commented 1 week ago

Hi!

Is the intention that the dawn dependencies should be added to my projects build.zig.zon

Yes, Zig's package manager requires that you add all non-lazy dependencies and sub-dependencies to your build.zig.zon. You can manually copy the dependency entries out of the lib's build.zig.zon info your projects build.zig.zon, or give the URLs to zig fetch --save {url}.

I will update all of the lib READMEs to explain this setup step and ensure URLs are kept up to date.

Just for context I'm currently running zig version -> 0.14.0-dev.2034+56996a280

The main branch is currently tracking the latest Mach nominated version. You can check the .zigversion file for any revision to know what version that particular revision is targeting.

iamcdonald commented 1 week ago

@hazeycode thanks for the explanation