summaryrefslogtreecommitdiffhomepage
path: root/src/build.zig
AgeCommit message (Collapse)Author
2024-07-11[build.zig] GLFW Platform Detection Support (#4150)InventorXtreme
* Zig Both Linux Desktop Platform Support * Formating and Default Fix Made formating fit within raylib standards and changed the default option to support both X11 and wayland on Linux. * caught one hiding tab
2024-07-01[build.zig] Make emscripten build compatible with Zig 0.13.0 (#4121)Mike Will
2024-06-27[build.zig] pass the real build.zig file (#4113)InKryption
`@This()` was naively passed to `dependencyFromBuildZig` while inside a file that is not actually the build file, causing a panic when actually used. Passing `@import("../build.zig")` fixes this.
2024-06-27[build.zig] Leverage `dependencyFromBuildZig` (#4109)InKryption
2024-06-16[build.zig] Fix raygui build when using addRaygui externally (#4027)Viktor Pocedulić
When addRaygui is used from an external build, for example in a bindings project, the build of a generated `raygui.c` fails with "raylib.h not found" error from the compiler. I've traced this down to a raylib step not adding its `src/` to the shared list of include paths using `addIncludePath` but relying on `addCSourceFiles` `.root` to provide the implicit include path for raylib proper's own files. If raygui is later added to the step the compiler won't know where to look for `raylib.h` and friends and will fail to build. This change simply adds raylib's `src/` to the include path list.
2024-06-09Make addRaylib use options.opengl_version (#4049)carverdamien
2024-05-29[build.zig] Fix Zig emscripten build (#4012)Dylan
* Fix for issue #4010 Split the code for Zig's master branch and >= 0.12.0 due to changes in https://github.com/ziglang/zig/pull/19623 * Restore the cache_include path which was removed in error Accidently removed a couple lines I didn't mean to 🙈
2024-05-15LazyPath.path has been deprecated, using b.path() (#3983)CosmicBagel
This works in zig 0.12, LazyPath.path has been removed in zig 0.13 Co-authored-by: CosmicBagel <>
2024-05-13feat(zig): add `opengl_version` option (#3979)Alexei Mozaidze
Added `opengl_version` option to `src/build.zig`.
2024-04-22[build.zig] Drop support for 0.11.0 and use more idiomatic build script code ↵freakmangd
(#3927) * Remove support for 0.11.0, and make build script more idiomatic + remove all 0.11.0 compatibility functions + remove most LazyPath .path variants + I didn't touch emscripten, I don't know if its relative or absolute + change all absolute paths to use .cwd_relative + only use the builder allocator + have local dependencies use the package manager + make adding raygui more flexible + use zig-cache for generated wayland files * Remove support for 0.11.0 in examples/build.zig * update examples further and add clarifying comment on addRaygui
2024-04-13Fix FileNotFound: .../src/raylib.h (#3915)Dylan
2024-04-13[build.zig] Fix local dependency breakage (#3913)freakmangd
* fix local dependency breakage * revert accidental change in include path
2024-04-10Update to latest zig and simplify build.zig (#3905)freakmangd
* update to latest zig, and don't use srcdir * preserve compatibility, simplify Child.run compatibility
2024-04-05Fix #3891 breaking builds for Zig v0.11.0 (#3896)iarkn
The changes brought by #3891 uses `std.process.Child.run` which was renamed from `std.process.Child.exec` in Zig version 0.11.0. This commit adds a version check to use the appropriate function names. Additionally, the `linux_display_backend` configuration option is added so users can set it when running `zig build` with the `-D` option or when using raylib as a dependency.
2024-03-30Fixes zig build that was broken on #3863 (#3891)Nikolas Mauropoulos
* Fixes zig build that was broken on #3863 * Make this work with wayland
2024-03-01Fix fix-build-paths (#3849)Caleb Barger
2024-02-26fix build paths (#3835)Steve Biedermann
2024-02-22Remove all uses of deps/mingw (#3805)Peter0x44
The purpose of this directory in GLFW is to provide some headers that "mingw.org" doesn't. Raylib has long been unable to build with mingw.org due to using certain symbols that aren't exposed in their headers. (_ftelli64 and _access, among others.). Mingw-w64 already has the necessary headers included, and doesn't need any of these external implementations. For some reason, this also causes the following error when building with Visual Studio's clang: clang -c rglfw.c -Wall -D_GNU_SOURCE -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing -std=c99 -O1 -Werror=implicit-function-declaration -I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw In file included from rglfw.c:61: In file included from ./external/glfw/src/init.c:30: In file included from ./external/glfw/src/internal.h:331: In file included from ./external/glfw/src/platform.h:31: In file included from ./external/glfw/src/win32_platform.h:70: external/glfw/deps/mingw\xinput.h:227:26: error: a parameter list without types is only allowed in a function definition 227 | void WINAPI XInputEnable(WINBOOL); | If the last -Iexternal/glfw/deps/mingw is removed, the build works fine. So, this workaround causes other problems, while not actually helping raylib. https://github.com/glfw/glfw/blob/0bb605cd797e4d63709495f4074ec59362064ab4/src/CMakeLists.txt#L272-L279 GLFW's CMakeLists.txt first checks if either dinput.h or xinput.h are provided by the toolchain, before telling the compiler to search for headers in that directory. For EVERY compiler that can build raylib, this is true. In summary: This directory causes issues when building with some compilers, and every toolchain that needs this workaround can't build raylib anyway.
2024-01-13Add shared library build option for build.zig and update to zig ↵Andrew Lee
0.12.0-dev.2139 (#3727) * update build.zig to 0.12.0-dev.2139 and add shared lib option * add no-sanitize workarounds
2024-01-11Update to latest zig 0.12.0dev while keeping 0.11.0 compatibility (#3715)freakmangd
* update build.zig for latest zig 0.12.0dev while still allowing 0.11.0 * update examples/build.zig and add nicer message for type mismatch
2023-12-28[ fix-crash-caused-by-zig-build ] - Fixed 'Illegal instruction' crash on ↵WisonYe
'rtextures' and 'raudio' model that caused by zig build. (#3682)
2023-11-04Allow raylib to be built with zig 0.11.0 and zig 0.12.0dev (master) (#3506)freakmangd
* allow zig 0.11.0 and 0.12.0dev to build raylib * update comment
2023-11-02build.zig updates for 0.11.0 release. (#3501)Caleb Barger
2023-10-17fix build.zig (#3433)Michael Scherbakow
for zig master (2023-10-17)
2023-10-14Fix raygui.c leftover from zig build (#3417)Blue
2023-10-13fix zig syntax errors in examples, and make it install executables correctly ↵Purple4pur
(#3395)
2023-10-10Revert "Update zig build system to zig version 0.11.0 (#3393)"Ray
This reverts commit 540ad9944205235cd9ccbd716c5a667daf929616.
2023-10-09Update zig build system to zig version 0.11.0 (#3393)Purple4pur
* 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
2023-09-09Revert "Disable UBSAN in zig builds. (#3292)" (#3303)Ryan Roden-Corrent
This reverts commit a316f9e7fc7f8e06852a40544e57f89018672ee4. Issue #1891 was fixed again, so this is no longer needed.
2023-09-05Disable UBSAN in zig builds. (#3292)Ryan Roden-Corrent
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.
2023-08-20add build.zig options for individual modules (#3254)actondev (Christos)
2023-08-06Tweak build.zig to work with cross-compiling (#3225)yujiri8
2023-08-01build change (#3214)Matheus C. França
ref.: https://github.com/ziglang/zig/pull/16446
2023-07-21build.zig: Support for building with PLAFORM_DRM (#3191)Jakub Václav Flasar
- Adds an option -Dplatform_drm when using zig build - When building for linux, checks whether -Dplatform_drm is present and configures the build accordingly.
2023-06-18Add options to zig compile (#3115)Dante Catalfamo
* 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
2023-05-30build.zig: Fix cross-compiling from Linux (#3090)yujiri8
2023-05-15Reverted commits that deprecated the build.zig files, and added a note to ↵Gamer-Kold
all of them stating version of zig they were using (#3060) * Revert "Fixed broken build.zig files. Now works with latest stable compiler (as of commit, latest is 0.10.1) (#3045)" This reverts commit de748dfffefeba1ba9bcf0c90c538d32c9cb2020 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
2023-05-14Update build.zig be be able to build with current zig master (#3064)Michael Scherbakow
2023-05-06Fixed broken build.zig files. Now works with latest stable compiler (as of ↵Gamer-Kold
commit, latest is 0.10.1) (#3045) Co-authored-by: Talha Qamar <[email protected]>
2023-05-01fix for latest zig master (#3037)star-tek-mb
2023-02-06zig build: do not use deprecated functions (#2913)star-tek-mb
2023-02-05update zig build to latest master (#2910)star-tek-mb
also, adds package manager support
2023-02-01Add WASM support for Zig build (#2901)Nikolas
* Add WASM support for Zig build * Improve Web example building * Remove emscript example building with Zig again * Readd windows emscripten variables
2022-11-09Add frameworks needed on macos (#2793)Martin Wickham
2022-10-20build.zig: let user decide how to set build mode + fix linker warning (#2763)InKryption
* 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.
2022-10-02Update build.zig to work with last GLFW update (#2737)_Tradam
2022-09-27update build.zig (#2720)Michael Scherbakow
zig `master` now enforces to use addIncludePath instead of addIncludeDir
2022-03-11Simplify build.zig to not require user to specify raylib path (#2383)Komari Spaghetti
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.
2022-02-09Add BSD support for zig builds (#2332)Scribe of the Ziggurat
- 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 !
2022-01-08Make zig build functionality available to zig programs (#2271)Nikolas