(macOS) Set up CROSS_COMPILE for ARM 64bit

This commit is contained in:
twinaphex 2021-01-28 15:45:05 +01:00
parent 67d8e59858
commit cf151679c0
2 changed files with 21 additions and 0 deletions

View File

@ -33,6 +33,10 @@ include:
# MacOS 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-x64.yml'
# MacOS ARM 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-arm64.yml'
################################## CELLULAR ################################
# Android
@ -117,6 +121,12 @@ libretro-build-osx-x64:
extends:
- .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

View File

@ -34,6 +34,9 @@ ifeq ($(shell uname -a),)
else ifneq ($(findstring Darwin,$(shell uname -a)),)
system_platform = osx
arch = intel
ifeq ($(shell uname -p),arm64)
arch = arm
endif
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
@ -82,6 +85,14 @@ else
CXXFLAGS += -mmacosx-version-min=10.9
CXXFLAGS += -stdlib=libc++
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)
ARCHFLAGS =
endif
ifndef ($(NOUNIVERSAL))
CFLAGS += $(ARCHFLAGS)
CXXFLAGS += $(ARCHFLAGS)