Skip to content

How to compile against the SDL backend #3764

Closed Answered by Peter0x44
Sqvid asked this question in Q&A
Discussion options

You must be logged in to vote

@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:

-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 make PLATFORM=PLATFORM_DESKTOP_SDL, and also run make clean first, if necessary.
This…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@Sqvid
Comment options

@gen2brain
Comment options

@Sqvid
Comment options

Comment options

You must be logged in to vote
1 reply
@Sqvid
Comment options

Answer selected by Sqvid
Comment options

You must be logged in to vote
2 replies
@Peter0x44
Comment options

@BrownNPC
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants