-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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] build.zig
, cannot change desktop platform backend for Linux
#4457
Comments
My work around for linux and changing the backend (I use Angle), is to make changes to the make file (platform, gl version, and CC and AR) and run Make with Zig that way. Just an option. |
@Ar1gin Good catch! Reviewing it know! EDIT: Checking the code, it seems you can just define EDIT 2: Ok, if I understand correctly, this is a |
Sure is. Looks like |
@Ar1gin Thanks for the confirmation! Please note that some of the required libraries for some of the available Desktop backends are not included with raylib, so, it's up to the user to provide them or configure paths for those libraries. Here a summary: |
build.zig
, cannot change desktop platform backend for Linux
The cmake build has sdl support, |
Thanks for your solution suggestions, but I need raylib to be built with If |
@Ar1gin Feel free to send several PRs, but please, keep PRs focused on topics, do not mix. |
Issue description
It's impossible to choose any backend other than GLFW if building with zig.
PLATFORM_DESKTOP
is set together with the platform backend you chose (PLATFORM_DESKTOP_SDL
in my case)raylib/build.zig
Lines 44 to 53 in 9e2591e
PLATFORM_DESKTOP
defaults toPLATFORM_DESKTOP_GLFW
.Then,
platforms/rcore_desktop_glfw.c
gets included without any regard to the backend choice.raylib/src/rcore.c
Lines 511 to 519 in 9e2591e
Possible fix
I got it to work by doing following changes to
build.zig
:raylib.defineCMacro("PLATFORM_DESKTOP", null);
fromsetDesktopPlatform()
(why was it there in the first place?)raylib.linkSystemLibrary("SDL2");
tocompileRaylib()
(SDL2 is not linked even with-Dplatform=sdl
!)Not opening a PR as I am unsure how to properly fix the problem.
Also, I may be missing something, I just need raylib to work with touchscreens (which are only supported by SDL backend) in my little zig project.
The text was updated successfully, but these errors were encountered: