Skip to content

build.zig: let user decide how to set build mode + fix linker warning - #2763

Merged
raysan5 merged 2 commits into
raysan5:masterfrom
InKryption:patch-1
Oct 20, 2022
Merged

build.zig: let user decide how to set build mode + fix linker warning#2763
raysan5 merged 2 commits into
raysan5:masterfrom
InKryption:patch-1

Conversation

@InKryption

@InKryption InKryption commented Oct 17, 2022

Copy link
Copy Markdown
Contributor

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

raysan5 commented Oct 20, 2022

Copy link
Copy Markdown
Owner

@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