From aae9ed41b6e2d483b1c5aab2d6b76bfb5117e8a6 Mon Sep 17 00:00:00 2001 From: Xenthio Date: Tue, 30 Nov 2021 11:24:51 +1100 Subject: [PATCH] Change makefile for SDL2 to work correctly on macOS --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9ab49a3b..3ea2541a 100644 --- a/Makefile +++ b/Makefile @@ -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