* update build.zig for zig 0.11.0
* fix build.zig in examples to install executable correctly
* discard build.zig, only use src/build.zig, to avoid annoying zig-out path problem
* update zig version note
Zig debug builds automatically enable ubsan.
As the fix for #1891 had to be reverted, debug builds using zig will crash like so:
```
Illegal instruction at address 0x3237d2
raylib/src/rlgl.h:3690:91: 0x3237d2 in rlDrawVertexArrayElements (/home/rcorre/src/raylib-zig-template/raylib/src/rcore.c)
glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (const unsigned short *)buffer + offset);
```
This disables UBSAN when using zig to build raylib.
- Adds an option -Dplatform_drm when using zig build
- When building for linux, checks whether -Dplatform_drm is present and configures the build accordingly.
* Add options to zig compile options
Support for compiling with raygui, raymath, and physac.
Also outputs the required headers.
Raygui should be located `../raygui` relative to the repo root
Physac should be located `../physac` relative to the repo root
This behavior matches options in the Makefile
* Move Options struct
* Remove physac, explicit raymath, always copy rlgl.h and raymath.h
* Remove unused options from build.zig
* Add srcdir as include path for raygui.h
* Revert "Fixed broken build.zig files. Now works with latest stable compiler (as of commit, latest is 0.10.1) (#3045)"
This reverts commit de748dfffe so that zig
build script works with master branch of zig.
* Added a note to build.zig files that denotes what version of zig they have been tested with.
* Standardised the note in the build.zig files
* build.zig: let user decide how to set build mode
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.
* build.zig: set root_src param to `null`
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.
We can figure out the source file location based on the location of the
build.zig file. No need to require the library user to specify where
raylib is stored.
- Adds a new OS clause to build.zig for the BSDs
- Tested on my FreeBSD box using https://github.com/Not-Nik/raylib-zig
- All demos build and render just fine. Nice !