Add support for Zig 1.13 & update Raylib to latest#46
Add support for Zig 1.13 & update Raylib to latest#46AtishaRibeiro wants to merge 1 commit intoryupold:mainfrom
Conversation
|
Hey, this gives me an error compiling with 0.13.0, with all the instructions from the pr readme I noticed the pr didn't have a |
|
I can't tell from your snippet but your There's probably a better way of doing this where you put the zon file in |
|
Still not working. Here is what I done.
build.zig.zon
|
The path for the dependecy in |
@AtishaRibeiro I noticed in your message that you seem to be importing the submodule with the name git submodule add -f https://github.com/AtishaRibeiro/raylib.zig raylib-zigThat took care of the Also using zig 0.13.0. Just wondering if you have any hints. Thank you for opening this PR! |
|
I resolved the diff --git a/build.zig b/build.zig
index 2170cf8..7eb96cc 100644
--- a/build.zig
+++ b/build.zig
@@ -89,11 +89,11 @@ const dir_raylib = cwd ++ sep ++ "raylib" ++ sep ++ "src";
const raylib_build = @import("raylib");
-fn linkThisLibrary(b: *std.Build, target: std.Target.Query, optimize: std.builtin.Mode) *std.Build.Step.Compile {
+fn linkThisLibrary(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.Mode) *std.Build.Step.Compile {
const lib = b.addStaticLibrary(
.{
.name = "raylib.zig",
- .target = b.resolveTargetQuery(target),
+ .target = target,
.optimize = optimize,
.root_source_file = std.Build.LazyPath{
.cwd_relative = cwd ++ sep ++ "raylib.zig",
@@ -110,10 +110,10 @@ fn linkThisLibrary(b: *std.Build, target: std.Target.Query, optimize: std.builti
}
/// add this package to exe
-pub fn addTo(b: *std.Build, exe: *std.Build.Step.Compile, target: std.Target.Query, optimize: std.builtin.Mode, raylibOptions: anytype) void {
+pub fn addTo(b: *std.Build, exe: *std.Build.Step.Compile, target: std.Build.ResolvedTarget, optimize: std.builtin.Mode, raylibOptions: anytype) void {
const lib_raylib = raylib_build.addRaylib(
b,
- b.resolveTargetQuery(target),
+ target,
optimize,
raylibOptions,
) catch |err| std.debug.panic("addRaylib: {any}", .{err}); |
Continued on #41
Changes:
.zig-cacheto.gititnorebuild.zig.zonto readme, this is now needed with the latest raylibLazyPath'sComptimeStringMaptoStaticStringMapThese changes do mean that this is not backwards compatible with zig 0.12