Makefile: Allow specifying SDL_LIBRARIES to link, this helps with SDL3
This commit is contained in:
parent
505d5fcf1b
commit
98ad55fec2
|
|
@ -87,6 +87,8 @@ USE_EXTERNAL_GLFW ?= FALSE
|
||||||
# WARNING: Library is not included in raylib, it MUST be configured by users
|
# WARNING: Library is not included in raylib, it MUST be configured by users
|
||||||
SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include
|
SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include
|
||||||
SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
|
SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
|
||||||
|
SDL_LIBRARIES ?= -lSDL2 -lSDL2main
|
||||||
|
|
||||||
|
|
||||||
# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
|
# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
|
||||||
# NOTE: This variable is only used for PLATFORM_OS: LINUX
|
# NOTE: This variable is only used for PLATFORM_OS: LINUX
|
||||||
|
|
@ -415,12 +417,12 @@ endif
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
|
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# Libraries for Windows desktop compilation
|
# Libraries for Windows desktop compilation
|
||||||
LDLIBS = -lraylib -lSDL2 -lSDL2main -lopengl32 -lgdi32
|
LDLIBS = -lraylib $(SDL_LIBRARIES) -lopengl32 -lgdi32
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
# Libraries for Debian GNU/Linux desktop compiling
|
# Libraries for Debian GNU/Linux desktop compiling
|
||||||
# NOTE: Required packages: libegl1-mesa-dev
|
# NOTE: Required packages: libegl1-mesa-dev
|
||||||
LDLIBS = -lraylib -lSDL2 -lSDL2main -lGL -lm -lpthread -ldl -lrt
|
LDLIBS = -lraylib $(SDL_LIBRARIES) -lGL -lm -lpthread -ldl -lrt
|
||||||
|
|
||||||
# On X11 requires also below libraries
|
# On X11 requires also below libraries
|
||||||
LDLIBS += -lX11
|
LDLIBS += -lX11
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,8 @@ GLFW_LINUX_ENABLE_X11 ?= TRUE
|
||||||
# WARNING: Library is not included in raylib, it MUST be configured by users
|
# WARNING: Library is not included in raylib, it MUST be configured by users
|
||||||
SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include
|
SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include
|
||||||
SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
|
SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
|
||||||
|
SDL_LIBRARIES ?= -lSDL2 -lSDL2main
|
||||||
|
|
||||||
|
|
||||||
# Determine if the file has root access (only required to install raylib)
|
# Determine if the file has root access (only required to install raylib)
|
||||||
# "whoami" prints the name of the user that calls him (so, if it is the root user, "whoami" prints "root")
|
# "whoami" prints the name of the user that calls him (so, if it is the root user, "whoami" prints "root")
|
||||||
|
|
@ -586,7 +588,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
|
||||||
LDLIBS += -lX11
|
LDLIBS += -lX11
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
LDLIBS += -lSDL2 -lSDL2main
|
LDLIBS += $(SDL_LIBRARIES)
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW)
|
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user