You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to set up a little game, but my build.zig fails:
$ zig build
/home/tq/.cache/zig/p/1220e6c4e31599c25cc7df2b300ee5ece3d89ddf0c566dbb5e4eb8d0d49e32ad5bb6/generator/vulkan/build_integration.zig:80:21: error: no field named 'graph'in struct 'Build'
var man = b.graph.cache.obtain();
^~~~~
/home/tq/.local/apps/zigup/zig/0.12.0-dev.2063+804cee3b9/files/lib/std/Build.zig:1:1: note: struct declared here
const std = @import("std.zig");
^~~~~
referenced by:
create: /home/tq/.cache/zig/p/1220e6c4e31599c25cc7df2b300ee5ece3d89ddf0c566dbb5e4eb8d0d49e32ad5bb6/generator/vulkan/build_integration.zig:29:27
build: /home/tq/.cache/zig/p/1220e6c4e31599c25cc7df2b300ee5ece3d89ddf0c566dbb5e4eb8d0d49e32ad5bb6/build.zig:50:31
remaining reference traces hidden; use '-freference-trace' to see all reference traces
My build.zig:
conststd=@import("std");
pubconstFrontend=enum {
client,
server,
};
pubconstLibType=enum {
static,
shared,
};
pubfnbuild(b: *std.Build) void {
// Optionsconstopt_target=b.standardTargetOptions(.{});
constopt_optimize=b.standardOptimizeOption(.{});
constopt_frontend=b.option(Frontend, "frontend", "Whether to produce a client or server executbale") orelseFrontend.client;
constopt_serverLibType=b.option(LibType, "server_lib_type", "Whether to build the server as a static or a shared library") orelseLibType.static;
// Server libraryconstthServer_args= .{
.name="thorium_server",
.root_source_file= .{ .path="src/server/root.zig" },
.target=opt_target,
.optimize=opt_optimize,
};
constthServer=switch (opt_serverLibType) {
.static=>b.addStaticLibrary(thServer_args),
.shared=>b.addSharedLibrary(thServer_args),
};
// Client/server executableconstthClient=switch (opt_frontend) {
.client=>b.addExecutable(.{
.name="thorium_client",
.root_source_file= .{ .path="src/client/main.zig" },
.target=opt_target,
.optimize=opt_optimize,
}),
.server=>b.addExecutable(.{
.name="thorium_server_cli",
.root_source_file= .{ .path="src/server/main.zig" },
.target=opt_target,
.optimize=opt_optimize,
}),
};
b.installArtifact(thClient);
// Dependencies for server (todo)// Dependencies for clientthClient.linkLibrary(thServer);
if (opt_frontend==Frontend.client) {
// GLFW dependencyconstglfw_dep=b.dependency("mach_glfw", .{
.target=opt_target,
.optimize=opt_optimize,
});
thClient.root_module.addImport("mach-glfw", glfw_dep.module("mach-glfw"));
// Vulkan dependencyconstvulkan_dep=b.dependency("vulkan_zig", .{
.registry=@as([] constu8, "deps/Vulkan-Headers/registry/vk.xml"),
});
thClient.root_module.addImport("vulkan", vulkan_dep.module("vulkan-zig"));
}
}
Maybe it's because I'm using zig version 0.12.0-dev.2063+804cee3b9 (2024.1.0-mach to be exact) and the API doesn't exist there yet, but I can't upgrade to master because I'm using mach-glfw.
The text was updated successfully, but these errors were encountered:
Yes, this was changed here: #118. I suggest to just use vulkan-zig from a commit before here, for now. Alternatively, we can check the compiler version and pick the new or the old code.
I'm trying to set up a little game, but my build.zig fails:
My build.zig:
Maybe it's because I'm using zig version
0.12.0-dev.2063+804cee3b9
(2024.1.0-mach
to be exact) and the API doesn't exist there yet, but I can't upgrade to master because I'm using mach-glfw.The text was updated successfully, but these errors were encountered: