From 6d5bd2db682b6d1fe73213e7a111ccb4227c108f Mon Sep 17 00:00:00 2001 From: Yoshi Sugawara Date: Wed, 4 Sep 2019 11:33:12 -1000 Subject: [PATCH] (iOS/tvOS) Support compiling for arm64 --- Makefile | 28 ++++++++++++++++++++++++---- libretro/config.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0b6e2a7..1bbd182 100644 --- a/Makefile +++ b/Makefile @@ -96,26 +96,46 @@ else ifneq (,$(findstring ios,$(platform))) TARGET := $(TARGET_NAME)_libretro_ios.dylib fpic := -fPIC SHARED := -dynamiclib + CFLAGS += -Wno-error=implicit-function-declaration -DHAVE_POSIX_MEMALIGN ifeq ($(IOSSDK),) IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path) endif +ifeq ($(platform),$(filter $(platform),ios-arm64)) + CC = cc -arch arm64 -isysroot $(IOSSDK) + CXX = c++ -arch arm64 -isysroot $(IOSSDK) +else CC = cc -arch armv7 -isysroot $(IOSSDK) - CC_AS = perl ./tools/gas-preprocessor.pl $(CC) CXX = c++ -arch armv7 -isysroot $(IOSSDK) -ifeq ($(platform),ios9) +endif + + CC_AS = perl ./tools/gas-preprocessor.pl $(CC) + +ifeq ($(platform),$(filter $(platform),ios9 ios-arm64)) CC += -miphoneos-version-min=8.0 CXX += -miphoneos-version-min=8.0 CC_AS += -miphoneos-version-min=8.0 - PLATFORM_DEFINES := -miphoneos-version-min=8.0 + PLATFORM_DEFINES := -miphoneos-version-min=8.0 -DIOS else CC += -miphoneos-version-min=5.0 CXX += -miphoneos-version-min=5.0 CC_AS += -miphoneos-version-min=5.0 - PLATFORM_DEFINES := -miphoneos-version-min=5.0 + PLATFORM_DEFINES := -miphoneos-version-min=5.0 -DIOS endif +# tvOS +else ifeq ($(platform), tvos-arm64) + + TARGET := $(TARGET_NAME)_libretro_tvos.dylib + fpic := -fPIC + SHARED := -dynamiclib + CFLAGS += -Wno-error=implicit-function-declaration -DHAVE_POSIX_MEMALIGN -DIOS + + ifeq ($(IOSSDK),) + IOSSDK := $(shell xcodebuild -version -sdk appletvos Path) + endif + # Theos else ifeq ($(platform), theos_ios) DEPLOYMENT_IOSVERSION = 5.0 diff --git a/libretro/config.h b/libretro/config.h index b1d8789..d241fe3 100644 --- a/libretro/config.h +++ b/libretro/config.h @@ -248,7 +248,9 @@ #define HAVE_STRTOL 1 /* Define to 1 if you have the `system' function. */ +#ifndef IOS #define HAVE_SYSTEM 1 +#endif /* Define to 1 if you have the header file, and it defines `DIR'. */