Skip to content

Zig build improvements#5702

Merged
raysan5 merged 1 commit into
raysan5:masterfrom
dotmrjosh:zig-improvements
Mar 28, 2026
Merged

Zig build improvements#5702
raysan5 merged 1 commit into
raysan5:masterfrom
dotmrjosh:zig-improvements

Conversation

@dotmrjosh
Copy link
Copy Markdown
Contributor

This fixes a minor dependency issue I was having and tweaks the build.zig a bit.

For some context, I was looking to use raylib to create games/apps with zig for the Miyoo Mini+ (a small linux gameboy like handheld) with the SDL backend.

I've done all this development on macos so apologies ahead of time that I can't test other platforms (except a niche linux one). However since this only affects the zig build, it should be reasonably low risk, and I think it's fair to expect the zig usage to come with some rough edges.

Changes

Zig min version bump

Past issues/PRs have agreed to follow the zig nightly builds. So this just bumps that version to the most recent one that I tested this PR with.

Added zig-pkg directory to gitignore

Zigs latest package manager places the packages/dependencies in the project root under zig-pkg so it can be ignored by git. (Similar to nodejs node_modules directory).

Add a None option for the LinuxDisplayBackend enum

In my niche case, Miyoo Mini+ doesn't have a desktop environment of any kind and the SDL implementation just directly talks to the frame buffer, so this option allows me to still build for linux, but omit X11 and Wayland sources.

Linux build potentially unnecessarily links rglfw.c

For some reason when I had SDL as the platform selected, it would still add rglfw.c for compilation causing issues (as glfw expects there to be X11 or Wayland on linux). There may be a couple more places this issue occurs but I have left them unchanged without any way to test currently.

xcode-frameworks dependency was incorrect

Zig could never build as the hash was not the correct format. The version being downloaded was not the latest commit so in fixing the hash, I've brought the dependency commit up to the most recent.

- Added zig-pkg directory to gitignore
- Brought min zig version to recent nightly release these improvements
  were completed on
- For linux build, only add rglfw.c if the platform is glfw
- Add a None option to the LinuxDisplayBackend
- Fixed xcode-frameworks dependency and update to using most recent
  commit hash
@raysan5 raysan5 merged commit 5915584 into raysan5:master Mar 28, 2026
@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Mar 28, 2026

@dotmrjosh thanks for the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants