Build for tvOS as a libretro core

This commit is contained in:
Eric Warmenhoven 2023-02-07 12:11:35 -05:00
parent 9b86000684
commit 40e92ce753
3 changed files with 28 additions and 5 deletions

View File

@ -53,6 +53,10 @@ include:
- project: 'libretro-infrastructure/ci-templates'
file: '/ios-cmake.yml'
# tvOS
- project: 'libretro-infrastructure/ci-templates'
file: '/tvos-cmake.yml'
################################## CONSOLES ################################
#################################### MISC ##################################
@ -146,3 +150,12 @@ libretro-build-ios-arm64:
- .cmake-defs
variables:
CORE_ARGS: -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/ios.cmake -DLIBRETRO=ON
# tvOS arm64
libretro-build-tvos-arm64:
extends:
- .libretro-tvos-cmake-arm64
- .core-defs
- .cmake-defs
variables:
CORE_ARGS: -DIOS_PLATFORM=TVOS -DUSE_FFMPEG=NO -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/ios.cmake -DLIBRETRO=ON

View File

@ -19,9 +19,14 @@ add_definitions(
)
set(OPENGL_LIBRARIES "-framework OpenGLES")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}")
if(IOS_PLATFORM STREQUAL "TVOS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mappletvos-version-min=${IPHONEOS_DEPLOYMENT_TARGET}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mappletvos-version-min=${IPHONEOS_DEPLOYMENT_TARGET}")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
# Standard settings
@ -31,7 +36,11 @@ set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(IOS ON)
set(CMAKE_CROSSCOMPILING ON)
set(CMAKE_MACOSX_BUNDLE YES)
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IPHONEOS_DEPLOYMENT_TARGET})
if(IOS_PLATFORM STREQUAL "TVOS")
#set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IPHONEOS_DEPLOYMENT_TARGET})
else()
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IPHONEOS_DEPLOYMENT_TARGET})
endif()
# Setup iOS platform unless specified manually with IOS_PLATFORM
if(NOT DEFINED IOS_PLATFORM)
@ -44,6 +53,8 @@ if(IOS_PLATFORM STREQUAL "OS")
set(IOS_SDK_NAME "iphoneos")
elseif(IOS_PLATFORM STREQUAL "SIMULATOR")
set(IOS_SDK_NAME "iphonesimulator")
elseif(IOS_PLATFORM STREQUAL "TVOS")
set(IOS_SDK_NAME "appletvos")
else()
message (FATAL_ERROR "Unsupported IOS_PLATFORM value selected '${IOS_PLATFORM}'. Please choose OS or leave default")
endif()
@ -63,7 +74,7 @@ set(CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Location of the selecte
set(CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS support")
# set the architecture for iOS
if(IOS_PLATFORM STREQUAL "OS")
if(IOS_PLATFORM STREQUAL "OS" OR IOS_PLATFORM STREQUAL "TVOS")
set(IOS_ARCH "arm64")
else()
set(IOS_ARCH "i386;x86_64")

View File

@ -98,7 +98,6 @@ static VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice_libretro(VkPhysicalDevice p
for (unsigned i = 0; i < vk_init_info.num_required_device_extensions; i++)
add_name_unique(EnabledExtensionNames, vk_init_info.required_device_extensions[i]);
add_name_unique(EnabledExtensionNames, VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME);
for (unsigned i = 0; i < sizeof(VkPhysicalDeviceFeatures) / sizeof(VkBool32); i++) {
if (((VkBool32 *)vk_init_info.required_features)[i])
((VkBool32 *)&EnabledFeatures)[i] = VK_TRUE;