Let macOS build set the SDK version
@@ -64,6 +64,13 @@ else ifeq ($(UNAME),Darwin)
LIBEXT=dylib
CFLAGS += -m$(ARCH) -I /opt/libjpeg-turbo/include -I /usr/local/opt/jpeg-turbo/include -I /usr/local/include -I /usr/local/opt/libvorbis/include -I /usr/local/opt/openal-soft/include -Dopenal_soft -DGL_SILENCE_DEPRECATION
LFLAGS += -Wl,-export_dynamic -L/usr/local/lib
+
+ifdef OSX_SDK
+ISYSROOT = $(shell xcrun --sdk macosx$(OSX_SDK) --show-sdk-path)
+CFLAGS += -isysroot $(ISYSROOT)
+LFLAGS += -isysroot $(ISYSROOT)
+endif
+
LIBFLAGS += -L/opt/libjpeg-turbo/lib -L/usr/local/opt/jpeg-turbo/lib -L/usr/local/lib -L/usr/local/opt/libvorbis/lib -L/usr/local/opt/openal-soft/lib
LIBOPENGL = -framework OpenGL
LIBOPENAL = -lopenal
