Skip to content
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

build.zig: Improve logic #4375

Merged
merged 4 commits into from
Oct 10, 2024
Merged

build.zig: Improve logic #4375

merged 4 commits into from
Oct 10, 2024

Conversation

sagehane
Copy link
Contributor

Currently, the project was failing to build when trying zig build inside the src/ dir instead of the root dir, due to hardcoding the path from the relative dir to "src", such that the compiler will try to look for $PROJECT_ROOT/src/src/<path> instead of $PROJECT_ROOT/src/<path>. I tried to fix all such instances of "src" with the parent directory of @src().file.

Also, exposed the Options type so people can do more things with it.

@raysan5 raysan5 merged commit d3f86eb into raysan5:master Oct 10, 2024
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Oct 10, 2024

@sagehane Thank you very much for the review!

@Not-Nik
Copy link
Contributor

Not-Nik commented Oct 13, 2024

This breaks the build for me on Zig 0.13, because the path is no longer relative. Platform is macOS 14.6.1

@raysan5
Copy link
Owner

raysan5 commented Oct 13, 2024

@sagehane please, could you review @Not-Nik issue?

@sagehane
Copy link
Contributor Author

sagehane commented Oct 13, 2024

Yes, I'll try. I'm sorry, seems this breaks for 0.12.0 too (which is the advertised supported version). There were other confusing aspects of the build system so I'll take a look.

It looks like @src().file was recently modified to return the relative path of a file, while it previously used to return the absolute path.

psxdev pushed a commit to raylib4Consoles/raylib that referenced this pull request Nov 18, 2024
* build.zig: Fix `@src` logic

* build.zig: Clarify build error

* build.zig: Add option for enabling `raygui`

* build.zig: Expose `Options` type
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.

3 participants