Update zig version

This commit is contained in:
IntegratedQuantum 2024-01-12 20:58:58 +01:00
parent d3ad1b4d01
commit 8a8af8e46f
3 changed files with 19 additions and 12 deletions

View File

@ -1 +1 @@
0.12.0-dev.1746+19af8aac8
0.12.0-dev.2150+63de8a598

View File

@ -1,11 +1,12 @@
const std = @import("std");
pub fn build(b: *std.build.Builder) !void {
pub fn build(b: *std.Build) !void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
const t = target.result;
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
@ -15,6 +16,7 @@ pub fn build(b: *std.build.Builder) !void {
.root_source_file = .{.path = "src/main.zig"},
.target = target,
.optimize = optimize,
//.sanitize_thread = true,
});
exe.linkLibC();
exe.linkLibCpp();
@ -29,27 +31,32 @@ pub fn build(b: *std.build.Builder) !void {
exe.linkSystemLibrary("cubyz_deps");
exe.addRPath(deps.path("lib")); // TODO: Maybe move the library next to the executable, to make this more portable?
if(target.getOsTag() == .windows) {
if(t.os.tag == .windows) {
exe.linkSystemLibrary("ole32");
exe.linkSystemLibrary("winmm");
exe.linkSystemLibrary("uuid");
exe.linkSystemLibrary("gdi32");
exe.linkSystemLibrary("opengl32");
exe.linkSystemLibrary("ws2_32");
} else if(target.getOsTag() == .linux) {
} else if(t.os.tag == .linux) {
exe.linkSystemLibrary("asound");
exe.linkSystemLibrary("x11");
exe.linkSystemLibrary("GL");
} else {
std.log.err("Unsupported target: {}\n", .{ target.getOsTag() });
std.log.err("Unsupported target: {}\n", .{t.os.tag});
}
exe.addAnonymousModule("gui", .{.source_file = .{.path = "src/gui/gui.zig"}});
exe.addAnonymousModule("server", .{.source_file = .{.path = "src/server/server.zig"}});
exe.root_module.addAnonymousImport("gui", .{
.target = target,
.optimize = optimize,
.root_source_file = .{.path = "src/gui/gui.zig"},
});
exe.root_module.addAnonymousImport("server", .{
.target = target,
.optimize = optimize,
.root_source_file = .{.path = "src/server/server.zig"},
});
//exe.strip = true; // Improves compile-time
//exe.sanitize_thread = true;
exe.disable_stack_probing = true; // Improves tracing of stack overflow errors.
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);

View File

@ -1126,7 +1126,7 @@ pub const Shader = struct {
const self = try Shader.init(vertex, fragment);
inline for(@typeInfo(@TypeOf(ptrToUniformStruct.*)).Struct.fields) |field| {
if(field.type == c_int) {
@field(ptrToUniformStruct, field.name) = c.glGetUniformLocation(self.id, field.name[0..] ++ "\x00"); // TODO: #16072
@field(ptrToUniformStruct, field.name) = c.glGetUniformLocation(self.id, field.name[0..]);
}
}
return self;
@ -1143,7 +1143,7 @@ pub const Shader = struct {
const self = try Shader.initCompute(compute);
inline for(@typeInfo(@TypeOf(ptrToUniformStruct.*)).Struct.fields) |field| {
if(field.type == c_int) {
@field(ptrToUniformStruct, field.name) = c.glGetUniformLocation(self.id, field.name[0..] ++ "\x00"); // TODO: #16072
@field(ptrToUniformStruct, field.name) = c.glGetUniformLocation(self.id, field.name[0..]);
}
}
return self;