Skip to content

Commit 70a7058

Browse files
committed
Enable compilation for ios-arm64 and tvos-arm64
1 parent 9604633 commit 70a7058

File tree

2 files changed

+33
-10
lines changed

2 files changed

+33
-10
lines changed

.gitlab-ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ android-x86:
201201
- .core-defs
202202

203203
# iOS
204-
#libretro-build-ios-arm64:
205-
# extends:
206-
# - .libretro-ios-arm64-make-default
207-
# - .core-defs
204+
libretro-build-ios-arm64:
205+
extends:
206+
- .libretro-ios-arm64-make-default
207+
- .core-defs
208208

209209
# iOS (armv7) [iOS 9 and up]
210210
#libretro-build-ios9:
@@ -213,10 +213,10 @@ android-x86:
213213
# - .core-defs
214214

215215
# tvOS
216-
#libretro-build-tvos-arm64:
217-
# extends:
218-
# - .libretro-tvos-arm64-make-default
219-
# - .core-defs
216+
libretro-build-tvos-arm64:
217+
extends:
218+
- .libretro-tvos-arm64-make-default
219+
- .core-defs
220220

221221
################################### CONSOLES #################################
222222
# PlayStation Portable

Makefile.libretro

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,19 @@ else ifeq ($(platform), osx)
9090
CFLAGS += $(ARCHFLAGS)
9191
LDFLAGS += $(ARCHFLAGS)
9292
endif
93-
93+
else ifeq ($(platform), tvos-arm64)
94+
TARGET := $(TARGET_NAME)_libretro_tvos.dylib
95+
fpic := -fPIC
96+
SHARED := -dynamiclib
97+
CFLAGS += -DIOS -DCHAILOVE_DISABLE_LOVE_SYSTEM_EXECUTE
98+
CXXFLAGS += -DCHAILOVE_DISABLE_LOVE_SYSTEM_EXECUTE
99+
ifeq ($(IOSSDK),)
100+
IOSSDK := $(shell xcodebuild -version -sdk appletvos Path)
101+
endif
102+
CC = cc -arch arm64 -isysroot $(IOSSDK)
103+
CXX = clang++ -arch arm64 -isysroot $(IOSSDK)
104+
CFLAGS += -DDONT_WANT_ARM_OPTIMIZATIONS -DHAVE_POSIX_MEMALIGN
105+
HAVE_NEON = 0
94106
# iOS
95107
else ifneq (,$(findstring ios,$(platform)))
96108

@@ -102,18 +114,22 @@ else ifneq (,$(findstring ios,$(platform)))
102114
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
103115
endif
104116
ifeq ($(platform),ios-arm64)
105-
CC = cc -arch arm64 -isysroot -DHAVE_POSIX_MEMALIGN $(IOSSDK)
117+
CC = cc -arch arm64 -isysroot $(IOSSDK)
118+
CXX = clang++ -arch arm64 -isysroot $(IOSSDK)
106119
CFLAGS += -DDONT_WANT_ARM_OPTIMIZATIONS
107120
HAVE_NEON = 0
108121
else
109122
CC = cc -arch armv7 -isysroot $(IOSSDK)
123+
CXX = clang++ -arch armv7 -isysroot $(IOSSDK)
110124
endif
111125
CFLAGS += -DIOS
112126
ifeq ($(platform),$(filter $(platform),ios9 ios-arm64))
113127
CC += -miphoneos-version-min=8.0 -DHAVE_POSIX_MEMALIGN
128+
CXX += -miphoneos-version-min=8.0 -DHAVE_POSIX_MEMALIGN
114129
CFLAGS += -miphoneos-version-min=8.0 -DHAVE_POSIX_MEMALIGN
115130
else
116131
CC += -miphoneos-version-min=5.0
132+
CXX += -miphoneos-version-min=5.0
117133
CFLAGS += -miphoneos-version-min=5.0
118134
endif
119135

@@ -607,6 +623,13 @@ ifeq ($(platform), ios-arm64)
607623
SOURCES_M += $(CORE_DIR)/vendor/physfs/src/physfs_platform_apple.m
608624
endif
609625

626+
ifeq ($(platform), tvos-arm64)
627+
LDFLAGS += -framework Foundation
628+
FLAGS += -D__MACH__ -D__APPLE__ -DPHYSFS_PLATFORM_APPLE
629+
FLAGS += -DCHAILOVE_DISABLE_LOVE_SYSTEM_EXECUTE
630+
SOURCES_M += $(CORE_DIR)/vendor/physfs/src/physfs_platform_apple.m
631+
endif
632+
610633
ifeq ($(EXTERNAL_ZLIB), 1)
611634
CFLAGS += -DHAVE_EXTERNAL_ZLIB
612635
endif

0 commit comments

Comments
 (0)