Skip to content

Commit 4a163b9

Browse files
authored
Merge pull request #405 from phcoder/ios
Enable compilation for ios-arm64 and tvos-arm64
2 parents a236319 + 70a7058 commit 4a163b9

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
@@ -205,10 +205,10 @@ android-x86:
205205
- .core-defs
206206

207207
# iOS
208-
#libretro-build-ios-arm64:
209-
# extends:
210-
# - .libretro-ios-arm64-make-default
211-
# - .core-defs
208+
libretro-build-ios-arm64:
209+
extends:
210+
- .libretro-ios-arm64-make-default
211+
- .core-defs
212212

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

219219
# tvOS
220-
#libretro-build-tvos-arm64:
221-
# extends:
222-
# - .libretro-tvos-arm64-make-default
223-
# - .core-defs
220+
libretro-build-tvos-arm64:
221+
extends:
222+
- .libretro-tvos-arm64-make-default
223+
- .core-defs
224224

225225
################################### CONSOLES #################################
226226
# 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

@@ -640,6 +656,13 @@ ifeq ($(platform), ios-arm64)
640656
SOURCES_M += $(CORE_DIR)/vendor/physfs/src/physfs_platform_apple.m
641657
endif
642658

659+
ifeq ($(platform), tvos-arm64)
660+
LDFLAGS += -framework Foundation
661+
FLAGS += -D__MACH__ -D__APPLE__ -DPHYSFS_PLATFORM_APPLE
662+
FLAGS += -DCHAILOVE_DISABLE_LOVE_SYSTEM_EXECUTE
663+
SOURCES_M += $(CORE_DIR)/vendor/physfs/src/physfs_platform_apple.m
664+
endif
665+
643666
ifeq ($(EXTERNAL_ZLIB), 1)
644667
CFLAGS += -DHAVE_EXTERNAL_ZLIB
645668
endif

0 commit comments

Comments
 (0)