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: let user decide how to set build mode + fix linker warning #2763

Merged
merged 2 commits into from
Oct 20, 2022

Conversation

InKryption
Copy link
Contributor

@InKryption InKryption commented Oct 17, 2022

This should delegate the responsibility of calling standardReleaseOptions and setting the build mode of the *LibExeObjStep step to the caller, especially since this might not be the process by which one wants to determine the build mode.

Also changes hides getSrcDir to enforce usage of srcdir, and asserts that the file is in fact inside a directory.

Also fixes a linker error, by passing null to the root_src param of addStaticLibrary instead of the header file.

This should delegate the responsibility of calling `standardReleaseOptions` and setting the build mode of the `*LibExeObjStep` step to the caller, especially since this might not be the process by which one wants to determine the build mode.

Also changes hides `getSrcDir` to enforce usage of `srcdir`, and asserts that the file is in fact inside a directory.
Supplying the header file as the root source here appears to cause a linker warning of the form:
```
LLD Link... warning(link): unexpected LLD stderr:
ld.lld: warning: {build_root}/zig-cache/o/{hash}/libraylib.a: archive member '{build_root}/zig-cache/o/{hash}/raylib.o' is neither ET_REL nor LLVM bitcode
```
Passing `null` instead fixes it.
@InKryption InKryption changed the title build.zig: let user decide how to set build mode build.zig: let user decide how to set build mode + fix linker warning Oct 17, 2022
@raysan5 raysan5 merged commit 40cf84e into raysan5:master Oct 20, 2022
@raysan5
Copy link
Owner

raysan5 commented Oct 20, 2022

@InKryption I'm not an expert on Zig build system but I'm merging those changes.

@InKryption InKryption deleted the patch-1 branch June 26, 2024 22:00
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