Skip to content

Commit

Permalink
Merge pull request #1093 from orbea/sdl
Browse files Browse the repository at this point in the history
build: drop SDL1 support + use pkg-config for SDL2
  • Loading branch information
richard42 authored Oct 24, 2024
2 parents 0c4e4f6 + b007759 commit 485afc5
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions projects/unix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -351,26 +351,18 @@ endif

# test for presence of SDL
ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined)
SDL_CONFIG = $(CROSS_COMPILE)sdl2-config
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
SDL_CONFIG = $(CROSS_COMPILE)sdl-config
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
$(error No SDL development libraries found!)
else
ifeq ($(NETPLAY), 1)
SDL_LDLIBS += -lSDL_net
endif
# SDL1 doesn't support vulkan
VULKAN = 0
$(warning Using SDL 1.2 libraries)
endif
else
ifeq ($(NETPLAY), 1)
SDL_LDLIBS += -lSDL2_net
ifeq ($(shell $(PKG_CONFIG) --modversion sdl2 2>/dev/null),)
$(error No SDL2 development libraries found!)
endif
ifeq ($(NETPLAY), 1)
ifeq ($(shell $(PKG_CONFIG) --modversion SDL2_net 2>/dev/null),)
$(error No SDL2_net development libraries found!)
endif
SDL_CFLAGS += $(shell $(PKG_CONFIG) --cflags SDL2_net)
SDL_LDLIBS += $(shell $(PKG_CONFIG) --libs SDL2_net)
endif
SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs)
SDL_CFLAGS += $(shell $(PKG_CONFIG) --cflags sdl2)
SDL_LDLIBS += $(shell $(PKG_CONFIG) --libs sdl2)
endif
CFLAGS += $(SDL_CFLAGS)
LDLIBS += $(SDL_LDLIBS)
Expand Down

0 comments on commit 485afc5

Please sign in to comment.