(macOS) Set up CROSS_COMPILING for ARM 64bit

This commit is contained in:
twinaphex 2021-01-28 22:05:38 +01:00
parent fde2713ad1
commit 2960cc981e
2 changed files with 29 additions and 8 deletions

View File

@ -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'
@ -125,6 +129,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:

View File

@ -20,10 +20,13 @@ ifeq ($(platform),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -s)),)
platform = osx
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
arch = intel
ifeq ($(shell uname -p),arm64)
arch = arm
endif
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring win,$(shell uname -s)),)
platform = win
endif
@ -133,10 +136,18 @@ else ifeq ($(platform), osx)
fpic := -fPIC
SHARED := -dynamiclib
OSXVER = $(shell sw_vers -productVersion | cut -d. -f 2)
OSX_GT_MOJAVE = $(shell (( $(OSXVER) >= 14)) && echo "YES")
ifneq ($(OSX_GT_MOJAVE),YES)
fpic += -mmacosx-version-min=10.1
endif
OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
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)
CPPFLAGS += $(TARGET_RULE)
CXXFLAGS += $(TARGET_RULE)
LDFLAGS += $(TARGET_RULE)
endif
ifndef ($(NOUNIVERSAL))
CFLAGS += $(ARCHFLAGS)
CXXFLAGS += $(ARCHFLAGS)