How to access info in build.zig.zon from build.zig?

Continuing the discussion from New Zig Build System Documentation:

3 Likes

You will be able to do @import("build.zig.zon") directly from the build.zig file, but that depends on some work-in-progress enhancements to the compiler.

15 Likes

You will be able to do @import("build.zig.zon") directly from the build.zig file

I’ve tried this code.
But I’ve received a compilation error.

error: no module named 'build.zig.zon' available within module root.@build
    const bzz = @import("build.zig.zon");

Is this feature not supported yet?

Current environment:

$ zig version
0.14.0-dev.2126+e27b4647d
2 Likes