raysan5/raylib

[build] build.zig linux desktop compile fails with "Cannot disable Wayland and X11 at the same time"

SimonLSchlee opened this issue · 1 comments

  • I tested it on latest raylib version from master branch
  • I checked there is no similar issue already reported
  • I checked the documentation on the wiki
  • My code has no errors or misuse of raylib

Issue description

The build.zig fails to compile for linux desktop.

To get it to compile I had to add raylib.defineCMacro("_GLFW_X11", null); to the build.zig for linux desktop,
without it I got Cannot disable Wayland and X11 at the same time,
activating Wayland gave me other compile errors so I didn't for now.

I am not sure whether these defines should be handled in the build.zig or not.

To fix the issue in SimonLSchlee/zigraylib (a raylib example for using raylib with zig) I added the define for _GLFW_X11
in this raylib fork SimonLSchlee@66e2a58

Here is the issue SimonLSchlee/zigraylib#2 and the commit SimonLSchlee/zigraylib@359cadb

On the raylib discord I got the info that something similar was done to fix compilation for game-premake here: raylib-extras/game-premake@a67dab5
And that "The build.zig may need review for glfw 3.4"
https://discord.com/channels/426912293134270465/678183146419912704/1220839133237215372

I mainly open this issue here so that somebody who knows whether adding this define is the right thing to do,
can point us towards the right direction or say whether some other fix should be applied.

I think this issue has been already addressed.