Skip to content

Commit 8e2bea8

Browse files
committed
zig 0.15 compat fixes
Updated build system to use root_module and addLibrary with .linkage = .static Replaced all callconv(.C) with callconv(.c)
1 parent bf18e18 commit 8e2bea8

File tree

3 files changed

+1197
-1192
lines changed

3 files changed

+1197
-1192
lines changed

build.zig

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,25 @@ pub fn build(b: *std.Build) void {
1616

1717
const tests = b.addTest(.{
1818
.name = "zopengl-tests",
19-
.root_source_file = b.path("src/zopengl.zig"),
20-
.target = target,
21-
.optimize = optimize,
19+
.root_module = b.createModule(.{
20+
.root_source_file = b.path("src/zopengl.zig"),
21+
.target = target,
22+
.optimize = optimize,
23+
}),
2224
});
2325
b.installArtifact(tests);
2426

2527
test_step.dependOn(&b.addRunArtifact(tests).step);
2628
}
2729

28-
const lib = b.addStaticLibrary(.{
30+
const lib = b.addLibrary(.{
2931
.name = "zopengl",
30-
.root_source_file = b.path("src/zopengl.zig"),
31-
.target = target,
32-
.optimize = optimize,
32+
.linkage = .static,
33+
.root_module = b.createModule(.{
34+
.root_source_file = b.path("src/zopengl.zig"),
35+
.target = target,
36+
.optimize = optimize,
37+
}),
3338
});
3439
_ = b.installArtifact(lib);
3540
}

0 commit comments

Comments
 (0)