Skip to content

Commit

Permalink
Update to zig 13
Browse files Browse the repository at this point in the history
  • Loading branch information
L-Briand committed Jul 27, 2024
1 parent f04fbc5 commit e09a753
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.idea
zig-cache
.zig-cache
zig-out
release.tar.gz
6 changes: 3 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

- Raylib version `5.0`
- Raygui version `4.0`
- Zig version`0.12.0`
- Zig version`0.13.0`

# TLDR

Expand All @@ -33,8 +33,8 @@ Create a `build.zig.zon` file and use this project as dependency.
.dependencies = .{
.@"raylib-zig-bindings" = .{
.url = "https://github.com/L-Briand/raylib-zig-bindings/releases/download/1.0.0/release.tar.gz",
.hash = "12204794808e9d42878238af89afadb037e12351aa84f15ca9addad3ce12de0a610a",
.url = "https://github.com/L-Briand/raylib-zig-bindings/releases/download/1.1.0/release.tar.gz",
.hash = "122096dfc8994542d786f21d12806a9bb9bb388d3f731aa03b0cacda0f5c48de2b5c",
}
},
Expand Down
18 changes: 9 additions & 9 deletions raylib.build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub const RaylibSetup = struct {
step: *std.Build.Step.Compile,
) !void {
const glfwInclude = b.pathJoin(&[_][]const u8{ self.raylibSrcPath.getPath(b), "external", "glfw", "include" });
step.addIncludePath(.{ .path = glfwInclude });
step.addIncludePath(.{ .cwd_relative = glfwInclude });

try self.files.append("rglfw.c");
step.linkSystemLibrary("winmm");
Expand All @@ -180,13 +180,13 @@ pub const RaylibSetup = struct {
step: *std.Build.Step.Compile,
) !void {
const glfwInclude = b.pathJoin(&[_][]const u8{ self.raylibSrcPath.getPath(b), "external", "glfw", "include" });
step.addIncludePath(.{ .path = glfwInclude });
step.addIncludePath(.{ .cwd_relative = glfwInclude });

// On macos rglfw.c include Objective-C files.
try self.flags.append("-ObjC");
const cRglfw = b.pathJoin(&[_][]const u8{ self.raylibSrcPath.getPath(b), "rglfw.c" });
step.root_module.addCSourceFile(.{
.file = .{ .path = cRglfw },
.file = .{ .cwd_relative = cRglfw },
.flags = self.flags.items,
});
_ = self.flags.pop();
Expand Down Expand Up @@ -219,9 +219,9 @@ pub const RaylibSetup = struct {
step.linkSystemLibrary("m");

const glfwInclude = b.pathJoin(&[_][]const u8{ self.raylibSrcPath.getPath(b), "external", "glfw", "include" });
step.addIncludePath(.{ .path = glfwInclude });
step.addIncludePath(.{ .path = "/usr/include" });
step.addLibraryPath(.{ .path = "/usr/lib" });
step.addIncludePath(.{ .cwd_relative = glfwInclude });
step.addIncludePath(.{ .cwd_relative = "/usr/include" });
step.addLibraryPath(.{ .cwd_relative = "/usr/lib" });

switch (options.backend) {
.X11 => {
Expand Down Expand Up @@ -255,7 +255,7 @@ pub const RaylibSetup = struct {
step.linkSystemLibrary("rt");
step.linkSystemLibrary("m");
step.linkSystemLibrary("dl");
step.addIncludePath(.{ .path = "/usr/include/libdrm" });
step.addIncludePath(.{ .cwd_relative = "/usr/include/libdrm" });

step.defineCMacro("PLATFORM_DRM", null);
step.defineCMacro("EGL_NO_X11", null);
Expand Down Expand Up @@ -291,11 +291,11 @@ pub const RaylibSetup = struct {
const privateCode = basename ++ "-code.h";

const client_step = b.addSystemCommand(&.{ "wayland-scanner", "client-header" });
client_step.addFileArg(.{ .path = protocolDir });
client_step.addFileArg(.{ .cwd_relative = protocolDir });
step.addIncludePath(client_step.addOutputFileArg(clientHeader).dirname());

const private_step = b.addSystemCommand(&.{ "wayland-scanner", "private-code" });
private_step.addFileArg(.{ .path = protocolDir });
private_step.addFileArg(.{ .cwd_relative = protocolDir });
step.addIncludePath(private_step.addOutputFileArg(privateCode).dirname());

step.step.dependOn(&client_step.step);
Expand Down

0 comments on commit e09a753

Please sign in to comment.