From 29592dc40ded230a65dff4bc9d1c2a0bd7e2b139 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 28 Jan 2021 10:10:59 +0100 Subject: [PATCH] (macOS) Set up CROSS_COMPILE for ARM 64bit --- .gitlab-ci.yml | 10 ++++++++++ Makefile | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf83302..3d920a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,6 +33,10 @@ include: - project: 'libretro-infrastructure/ci-templates' file: '/osx-x64.yml' + # MacOS ARM 64-bit + - project: 'libretro-infrastructure/ci-templates' + file: '/osx-arm64.yml' + ################################## CELLULAR ################################ # Android - project: 'libretro-infrastructure/ci-templates' @@ -121,6 +125,12 @@ libretro-build-osx-x64: - .libretro-osx-x64-make-default - .core-defs +# MacOS ARM 64-bit +libretro-build-osx-arm64: + extends: + - .libretro-osx-arm64-make-default + - .core-defs + ################################### CELLULAR ################################# # Android ARMv7a android-armeabi-v7a: diff --git a/Makefile b/Makefile index 7f427a5..1756625 100644 --- a/Makefile +++ b/Makefile @@ -87,8 +87,16 @@ else ifeq ($(platform), osx) SHARED := -dynamiclib OSXVER = `sw_vers -productVersion | cut -d. -f 2` OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"` - fpic += -mmacosx-version-min=10.1 LDFLAGS += -framework CoreFoundation +ifeq ($(OSX_LT_MAVERICKS),YES) + fpic += -mmacosx-version-min=10.1 +endif + + ifeq ($(CROSS_COMPILE),1) + TARGET_RULE = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT) + CFLAGS += $(TARGET_RULE) + LDFLAGS += $(TARGET_RULE) + endif # iOS else ifneq (,$(findstring ios,$(platform)))