Set min macos ver based on if on intel or arm. Allow var to be edited (#209)

This commit is contained in:
EmeraldLockdown 2024-07-14 11:57:48 -05:00 committed by GitHub
parent 84833065f1
commit 035e04ee31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 3 deletions

View File

@ -59,6 +59,13 @@ HEADLESS ?= 0
ICON ?= 1 ICON ?= 1
# Use .app (for macOS) # Use .app (for macOS)
USE_APP ?= 1 USE_APP ?= 1
# Minimum macOS Version
# If our arch is arm, set to macOS 14
ifeq ($(shell arch),arm64)
MIN_MACOS_VERSION ?= 14
else
MIN_MACOS_VERSION ?= 10.15
endif
# Make some small adjustments for handheld devices # Make some small adjustments for handheld devices
HANDHELD ?= 0 HANDHELD ?= 0
@ -642,7 +649,7 @@ else ifeq ($(COMPILER),gcc)
ifeq ($(OSX_BUILD),0) ifeq ($(OSX_BUILD),0)
EXTRA_CFLAGS += -Wno-unused-result -Wno-format-truncation EXTRA_CFLAGS += -Wno-unused-result -Wno-format-truncation
else else
EXTRA_CFLAGS += -Wno-unused-result -mmacosx-version-min=14 EXTRA_CFLAGS += -Wno-unused-result -mmacosx-version-min=$(MIN_MACOS_VERSION)
endif endif
else ifeq ($(COMPILER),clang) else ifeq ($(COMPILER),clang)
CC := clang CC := clang
@ -753,8 +760,8 @@ else ifeq ($(findstring SDL,$(WINDOW_API)),SDL)
else ifeq ($(TARGET_RPI),1) else ifeq ($(TARGET_RPI),1)
BACKEND_LDFLAGS += -lGLESv2 BACKEND_LDFLAGS += -lGLESv2
else ifeq ($(OSX_BUILD),1) else ifeq ($(OSX_BUILD),1)
BACKEND_LDFLAGS += -framework OpenGL `pkg-config --libs glew` -mmacosx-version-min=14 BACKEND_LDFLAGS += -framework OpenGL `pkg-config --libs glew` -mmacosx-version-min=$(MIN_MACOS_VERSION)
EXTRA_CPP_FLAGS += -stdlib=libc++ -std=c++17 -mmacosx-version-min=14 EXTRA_CPP_FLAGS += -stdlib=libc++ -std=c++17 -mmacosx-version-min=$(MIN_MACOS_VERSION)
else else
BACKEND_LDFLAGS += -lGL BACKEND_LDFLAGS += -lGL
endif endif