-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Zig 1.13 & update Raylib to latest #46
base: main
Are you sure you want to change the base?
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-zig That 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-cache
to.gititnore
build.zig.zon
to readme, this is now needed with the latest raylibLazyPath
'sComptimeStringMap
toStaticStringMap
These changes do mean that this is not backwards compatible with zig 0.12