Skip to content

Commit

Permalink
iOS/tvOS support
Browse files Browse the repository at this point in the history
  • Loading branch information
XITRIX committed Aug 14, 2024
1 parent e314a30 commit c1fcb37
Show file tree
Hide file tree
Showing 32 changed files with 61 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build_switch
libromfs-generator
build-ios
build
vcpkg_installed
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set(VERSION_MAJOR "1")
set(VERSION_MINOR "2")
set(VERSION_ALTER "1")
set(VERSION_BUILD "1")
set(PACKAGE_NAME "com.xitrix.moonlight")
set(PACKAGE_NAME "ru.xitrix.Moonlight")
set(PSN_TITLE_ID "MNTL00000")
set(PSN_VERSION "01.00")
set(PROJECT_AUTHOR "XITRIX")
Expand Down Expand Up @@ -173,7 +173,12 @@ elseif (PLATFORM_IOS)
"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_ALTER}")
list(APPEND IOS_FRAMEWORKS ${CMAKE_CURRENT_SOURCE_DIR}/extern/borealis/library/lib/extern/angle/ios/MetalANGLE.framework)
set_target_properties(${PROJECT_NAME} PROPERTIES
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON)
INSTALL_RPATH @executable_path/Frameworks
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON
XCODE_ATTRIBUTE_INFOPLIST_KEY_LSApplicationCategoryType "public.app-category.games"
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks"
XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/extern/borealis/library/lib/extern/angle/ios/"
XCODE_ATTRIBUTE_INSTALL_PATH $(LOCAL_APPS_DIR))
elseif (PLATFORM_TVOS)
ios_bundle(
"${CMAKE_CURRENT_SOURCE_DIR}/app/platforms/ios/tvos/Splash.storyboard"
Expand All @@ -183,7 +188,13 @@ elseif (PLATFORM_TVOS)
"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_ALTER}")
list(APPEND IOS_FRAMEWORKS ${CMAKE_CURRENT_SOURCE_DIR}/extern/borealis/library/lib/extern/angle/tvos/MetalANGLE.framework)
set_target_properties(${PROJECT_NAME} PROPERTIES
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON)
INSTALL_RPATH @executable_path/Frameworks
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON
XCODE_ATTRIBUTE_INFOPLIST_KEY_LSApplicationCategoryType "public.app-category.games"
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks"
XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/extern/borealis/library/lib/extern/angle/tvos/"
XCODE_ATTRIBUTE_INSTALL_PATH $(LOCAL_APPS_DIR)
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIconTvOS")
endif ()

target_include_directories(${PROJECT_NAME} PUBLIC
Expand Down
24 changes: 24 additions & 0 deletions app/platforms/ios/Images.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "moonlight 1.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"filename" : "moonlight 2.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"images" : [
{
"filename" : "Frame 5.png",
"idiom" : "tv",
"scale" : "1x"
},
{
"filename" : "Frame [email protected]",
"idiom" : "tv",
"scale" : "2x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"images" : [
{
"filename" : "Frame 5.png",
"idiom" : "tv",
"scale" : "1x"
},
{
"filename" : "Frame [email protected]",
"idiom" : "tv",
"scale" : "2x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"images" : [
{
"filename" : "Frame 5.png",
"idiom" : "tv",
"scale" : "1x"
},
{
"filename" : "Frame [email protected]",
"idiom" : "tv",
"scale" : "2x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions app/platforms/ios/iOSBundleInfo.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,16 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>GCSupportedGameControllers</key>
<array>
<dict>
<key>ProfileName</key>
<string>ExtendedGamepad</string>
</dict>
</array>
<key>GCSupportsControllerUserInteraction</key>
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
</dict>
</plist>
3 changes: 3 additions & 0 deletions app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ int main(int argc, char* argv[]) {
// Exit
#ifdef __SWITCH__
nvExit();
#elif defined(PLATFORM_TVOS)
exit(0);
#endif

return EXIT_SUCCESS;
}
2 changes: 1 addition & 1 deletion extern/borealis
1 change: 1 addition & 0 deletions extern/cmake/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ elseif (PLATFORM_IOS OR PLATFORM_TVOS)
set(DEPLOYMENT_TARGET 13.0)
set(CMAKE_TOOLCHAIN_FILE ${EXTERN_PATH}/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE PATH "vcpkg toolchain file")
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${BOREALIS_LIBRARY}/cmake/ios.toolchain.cmake CACHE PATH "ios toolchain file")
set(CMAKE_SHARED_LINKER_FLAGS "-rpath @executable_path/Frameworks -rpath @loader_path/Frameworks")
set(USE_SDL2 ON)
set(USE_GLFW OFF)
set(USE_GLES3 ON)
Expand Down

0 comments on commit c1fcb37

Please sign in to comment.