Change makefile for SDL2 to work correctly on macOS

This commit is contained in:
Xenthio 2021-11-30 11:24:51 +11:00
parent 801096a846
commit aae9ed41b6
1 changed files with 6 additions and 1 deletions

View File

@ -532,7 +532,12 @@ else ifeq ($(SDL1_USED),1)
endif
ifneq ($(SDL1_USED)$(SDL2_USED),00)
BACKEND_CFLAGS += `$(SDLCONFIG) --cflags`
ifeq ($(OSX_BUILD),1)
MAC_PREFIX := `$(SDLCONFIG) --prefix`
BACKEND_CFLAGS +=-I$(MAC_PREFIX)/include `$(SDLCONFIG) --cflags` # macOS homebrew SDL2 has the config laid out differently so this makes it point to the correct folder + a failsafe for if it ever changes for some reason in the future.
else
BACKEND_CFLAGS += `$(SDLCONFIG) --cflags`
endif
ifeq ($(WINDOWS_BUILD),1)
BACKEND_LDFLAGS += `$(SDLCONFIG) --static-libs` -lsetupapi -luser32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion
else