libretro: build for iOS and tvOS (#77)

Makefile.libretro gains ios-arm64 and tvos-arm64, built the way
libretro-infrastructure's templates drive them: plain make with the host
clang on an Apple Silicon runner, pointed here at the device SDK and at a
12.0 deployment target - the lowest the templates' vtool check accepts as
IOS/TVOS. Code signing rules out writable executable memory on both, so they
take the generated 68K/Z80 cores, like every other arm64 build. The core
links neither OpenGL nor AppKit there, as neither exists. The GitLab CI
gains the two jobs.
This commit is contained in:
WizzardSK authored and GitHub committed 2026-09-26 09:39:20 -05:00
1 parent 42db375ba2
commit 1698577954
3 files changed
+47 -1

No files matched your search

+20
View File
@@ -59,6 +59,14 @@ include:
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-arm64.yml'
# iOS
- project: 'libretro-infrastructure/ci-templates'
file: '/ios-arm64.yml'
# tvOS
- project: 'libretro-infrastructure/ci-templates'
file: '/tvos-arm64.yml'
################################## CELLULAR ################################
# Android
- project: 'libretro-infrastructure/ci-templates'
@@ -132,6 +140,18 @@ libretro-build-osx-arm64:
- .libretro-osx-arm64-make-default
- .core-defs
# iOS
libretro-build-ios-arm64:
extends:
- .libretro-ios-arm64-make-default
- .core-defs
# tvOS
libretro-build-tvos-arm64:
extends:
- .libretro-tvos-arm64-make-default
- .core-defs
################################### CELLULAR #################################
# Android ARMv7a
android-armeabi-v7a:
+3
View File
@@ -179,9 +179,12 @@ LDFLAGS+= -pthread
endif
endif #libblastem.so
#iOS and tvOS have neither framework, and the libretro core needs neither.
ifeq ($(OS),Darwin)
ifndef APPLE_EMBEDDED
LDFLAGS+= -framework OpenGL -framework AppKit
endif
endif
endif #PORTABLE
endif #CPU=wasm
+24 -1
View File
@@ -33,6 +33,29 @@ endif
CORE_ARGS := NEW_CORE=1
target = libblastem.so
libname = blastem_libretro_android.so
else ifneq (,$(filter ios-arm64 tvos-arm64,$(platform)))
#iOS and tvOS, built the way libretro-infrastructure's ios-arm64 and
#tvos-arm64 jobs drive it: plain make with the host clang on an Apple Silicon
#runner. The compiler is pointed at the device SDK here, as neither template
#does it. Code signing forbids writable executable memory on both, so the
#generated 68K/Z80 cores are the only ones there are - the same ones every
#other arm64 build takes. 12.0 is the lowest deployment target whose binaries
#the templates' vtool check accepts as IOS/TVOS.
OS :=Darwin
ABI := aarch64
ifeq ($(platform),ios-arm64)
APPLE_SDK := iphoneos
APPLE_TARGET := arm64-apple-ios12.0
target = libblastem.dylib
libname = blastem_libretro_ios.dylib
else
APPLE_SDK := appletvos
APPLE_TARGET := arm64-apple-tvos12.0
target = libblastem.dylib
libname = blastem_libretro_tvos.dylib
endif
CC := $(shell xcrun --sdk $(APPLE_SDK) -f clang) -target $(APPLE_TARGET) -isysroot $(shell xcrun --sdk $(APPLE_SDK) --show-sdk-path)
CORE_ARGS := APPLE_EMBEDDED=1
else ifeq ($(MSYSTEM),MINGW64)
platform = win
OS :=Windows
@@ -125,7 +148,7 @@ ifneq (,$(or $(findstring webos,$(CROSS_COMPILE)),$(findstring starfish,$(CROSS_
endif
core: $(OBJ)
$(MAKE) $(target) OS=$(OS) CC=$(CC) CPU=$(ABI) LIBRETRO=$(LIBRETRO) $(CORE_ARGS)
$(MAKE) $(target) OS=$(OS) CC="$(CC)" CPU=$(ABI) LIBRETRO=$(LIBRETRO) $(CORE_ARGS)
cp -v $(target) $(libname)
install: $(libname)