Closed simendsjo closed 1 year ago
Thanks for the report. I see the problem. RAYMATH_IMPLEMENTATION
is defined in rcore.c after our definition in raymath.h. Not sure how it was working before; maybe I didn't have that line when I originally built Raylib. In any case, to get it built, you can either remove that line from raymath.h or use #ifndef
in rcore.c. Unfortunately Autowrap still needs it to get all of the symbols, so the patch itself is right. We just need better docs on how it should be applied.
FWIW, here's how I configured Raylib on Gentoo:
cmake -DCUSTOMIZE_BUILD=ON -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=ON -DUSE_EXTERNAL_GLFW=ON -DUSE_WAYLAND=ON -DWITH_PIC=ON -DOpenGL_GL_PREFERENCE=GLVND
And for Raygui, make an include dir and copy the raylib.h into it, then:
gcc -o libraygui.so src/raygui.c -shared -fpic -DRAYGUI_IMPLEMENTATION -lGL -lm -lpthread -ldl -lrt -I./include
If you do use EXTERNAL_GLFW and your GLFW is the latest stable (not dev), you'll run into an issue of Raylib expecting a bleeding-edge symbol that your GLFW doesn't have. The fix is to add this into rcore.c:
#if !defined(GLFW_MOUSE_PASSTHROUGH)
#define GLFW_MOUSE_PASSTHROUGH 0x0002000D
#endif
We don't have reproducible build docs yet because this stuff has been tested by maybe two people. Let me know if you get anywhere with that though, would love to put some up.
@mjkalyan: You have a Guix machine, right?
Thanks, worked great! Would be great to support raylib without custom patches, but I guess that's not possible?
The patches are minimal enough that I could see us getting to a point where they aren't needed. e.g. have a "wrapper" header for Raygui to #define RAYGUI_IMPLEMENTATION
and #include "raygui.h"
. Lots more to do on build/distribution so this is by no means a permanent state.
I don't understand what the patches are, and I'm failing to build raylib with them. You don't have an automated build for these or instructions on how to build them? I want to build from scratch as I'm hacking the libraries to work otherwise (running Guix System). I checked out the 4.2.0 tag, copied over raylib.h and raymath.h, and tried building, but I then get errors during build. Building without these patches works, but I guess they're there for a reason.
I get lot's of these errors with the raymath changes
The diff for my changes should be the same as in your repo: