-
I am currently facing Issue #3763 which is possibly due to the glfw backend. This made me wonder how I could go about linking against SDL instead. Though this was announced in the changelog, there don't seem to be any instructions on how to do this. I would greatly appreciate any help. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Just define
|
Beta Was this translation helpful? Give feedback.
-
@Sqvid Raylib's CMake setup does not currently support building against SDL, you must use the Makefile in raylib/src. -SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include
-SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
+SDL_INCLUDE_PATH ?= $(shell pkg-config --cflags sdl2)
+SDL_LIBRARY_PATH ?= $(shell pkg-config --libs sdl2)
- INCLUDE_PATHS += -I$(SDL_INCLUDE_PATH)
+ INCLUDE_PATHS += $(SDL_INCLUDE_PATH)
- LDFLAGS += -L$(SDL_LIBRARY_PATH)
+ LDFLAGS += $(SDL_LIBRARY_PATH) then build with Then, you can build your code against it with: |
Beta Was this translation helpful? Give feedback.
-
Why is this is still not supported by the CMakeLists.txt? |
Beta Was this translation helpful? Give feedback.
@Sqvid Raylib's CMake setup does not currently support building against SDL, you must use the Makefile in raylib/src.
My current strategy is to make the following changes to the Makefile:
then build with
make PLATFORM=PLATFORM_DESKTOP_SDL
, and also runmake clean
first, if necessary.This…