-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix build.zig #4374
Fix build.zig #4374
Conversation
I tried this and it worked perfectly (linux x64, zig 0.13.0):
|
I'm having the same issues with the latest commit on Linux, using the Seems to be introduced by #4358 where it caused a mismatch between the fields of Line 27 in 4050b55
Line 300 in 4050b55
|
How to reproduce:
const raylib = @import("raylib");
const raylib_lib = try raylib.addRaylib(b, target, optimize, .{});
$ zig build
/home/<user>/.cache/zig/p/12207c7d223c949e1bdfbb2a789770427e0c61d4c288ef0e8935b1dc52ac2f82f807/src/build.zig:27:33: error: no field named 'platform_drm' in struct 'src.build.Options'
.platform_drm = options.platform_drm,
^~~~~~~~~~~~
/home/<user>/.cache/zig/p/12207c7d223c949e1bdfbb2a789770427e0c61d4c288ef0e8935b1dc52ac2f82f807/src/build.zig:294:21: note: struct declared here
pub const Options = struct {
^~~~~~
referenced by:
build: /home/<user>/Projects/mario/build.zig:33:44
runBuild__anon_5106: /nix/store/h4xqfb0ganmpwzrzpbnxmhvy74r9hwfd-zig-0.14.0-dev.1823+b00cbecfd/lib/std/Build.zig:2294:33
6 reference(s) hidden; use '-freference-trace=8' to see all references |
I also needed the following patch to get it building: diff --git a/src/build.zig b/src/build.zig
index d79fb0f3..fef4893c 100644
--- a/src/build.zig
+++ b/src/build.zig
@@ -24,11 +24,11 @@ pub fn addRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
.rshapes = options.rshapes,
.rtext = options.rtext,
.rtextures = options.rtextures,
- .platform_drm = options.platform_drm,
+ .platform = options.platform,
.shared = options.shared,
.linux_display_backend = options.linux_display_backend,
.opengl_version = options.opengl_version,
- .config = options.config,
+ //.config = options.config,
});
const raylib = raylib_dep.artifact("raylib");
@@ -366,7 +366,7 @@ pub fn build(b: *std.Build) !void {
.shared = b.option(bool, "shared", "Compile as shared library") orelse defaults.shared,
.linux_display_backend = b.option(LinuxDisplayBackend, "linux_display_backend", "Linux display backend to use") orelse defaults.linux_display_backend,
.opengl_version = b.option(OpenglVersion, "opengl_version", "OpenGL version to use") orelse defaults.opengl_version,
- .config = b.option([]const u8, "config", "Compile with custom define macros overriding config.h") orelse null,
+ .config = b.option([]const u8, "config", "Compile with custom define macros overriding config.h"),
};
const lib = try compileRaylib(b, target, optimize, options); The |
@cedeon @CrackedPixel @sagehane Thanks for reporting! Please note that I don't maintain the |
I can only get zig to build raylib if I do this + move the file to the parent directory.