From 035e04ee31e282f7aa3d27c1b9b37a45738e4201 Mon Sep 17 00:00:00 2001 From: EmeraldLockdown <86802223+EmeraldLoc@users.noreply.github.com> Date: Sun, 14 Jul 2024 11:57:48 -0500 Subject: [PATCH] Set min macos ver based on if on intel or arm. Allow var to be edited (#209) --- Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7a3c2f09..343b336d 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,13 @@ HEADLESS ?= 0 ICON ?= 1 # Use .app (for macOS) 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 HANDHELD ?= 0 @@ -642,7 +649,7 @@ else ifeq ($(COMPILER),gcc) ifeq ($(OSX_BUILD),0) EXTRA_CFLAGS += -Wno-unused-result -Wno-format-truncation else - EXTRA_CFLAGS += -Wno-unused-result -mmacosx-version-min=14 + EXTRA_CFLAGS += -Wno-unused-result -mmacosx-version-min=$(MIN_MACOS_VERSION) endif else ifeq ($(COMPILER),clang) CC := clang @@ -753,8 +760,8 @@ else ifeq ($(findstring SDL,$(WINDOW_API)),SDL) else ifeq ($(TARGET_RPI),1) BACKEND_LDFLAGS += -lGLESv2 else ifeq ($(OSX_BUILD),1) - BACKEND_LDFLAGS += -framework OpenGL `pkg-config --libs glew` -mmacosx-version-min=14 - EXTRA_CPP_FLAGS += -stdlib=libc++ -std=c++17 -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=$(MIN_MACOS_VERSION) else BACKEND_LDFLAGS += -lGL endif