gen2brain / raylib-go

Go bindings for raylib, a simple and easy-to-use library to enjoy videogames programming.
zlib License
1.54k stars 157 forks source link

Can't run without Xinerama #404

Open denisstrizhkin opened 1 month ago

denisstrizhkin commented 1 month ago

I am using Wayland primarily so I am missing some X11 dependencies. You can compile Raylib without X11 though as it runs just fine for me with X11 disabled. Can the same be done for Go bindings?

# github.com/gen2brain/raylib-go/raylib
warning: unknown warning option '-Wno-stringop-overflow'; did you mean '-Wno-shift-overflow'? [-Wunknown-warning-option]
In file included from ../../../go/pkg/mod/github.com/gen2brain/raylib-go/raylib@v0.0.0-20240628125141-62016ee92fc0/cgo_linux.go:7:
In file included from ./external/glfw/src/context.c:28:
In file included from ./external/glfw/src/internal.h:325:
In file included from ./external/glfw/src/platform.h:81:
./external/glfw/src/x11_platform.h:45:10: fatal error: 'X11/extensions/Xinerama.h' file not found
   45 | #include <X11/extensions/Xinerama.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
denisstrizhkin commented 1 month ago

I think this could be solved by adding wayland build tag that would compile without X11 enabled

gen2brain commented 1 month ago

There was already a wayland build tag because GLFW supported either one or another, with the latest changes it is possible to have the same binary that works on both Wayland and X11 and it will choose it on runtime. That is the default and the preferred way, not sure why someone would prefer again different binaries for one or another, but I agree that the option would be nice, if possible. I will check this after the summer is over. You also have the option to use SDL instead of GLFW.