mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 05:37:57 +03:00
Build libretro core for tvOS
This commit is contained in:
parent
c09de54d4f
commit
25a03f957b
4 changed files with 31 additions and 8 deletions
|
@ -10,7 +10,8 @@
|
|||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CORENAME: play
|
||||
API_LEVEL: 19
|
||||
CORE_ARGS: -DBUILD_LIBRETRO_CORE=ON -DBUILD_PLAY=OFF -DENABLE_AMAZON_S3=off -DBUILD_TESTS=OFF
|
||||
BASE_CORE_ARGS: -DBUILD_LIBRETRO_CORE=ON -DBUILD_PLAY=OFF -DENABLE_AMAZON_S3=off -DBUILD_TESTS=OFF
|
||||
CORE_ARGS: $BASE_CORE_ARGS
|
||||
EXTRA_PATH: Source/ui_libretro
|
||||
|
||||
.core-defs-win:
|
||||
|
@ -48,6 +49,10 @@ include:
|
|||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/ios-cmake.yml'
|
||||
|
||||
# tvOS
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/tvos-cmake.yml'
|
||||
|
||||
# Stages for building
|
||||
stages:
|
||||
- build-prepare
|
||||
|
@ -126,7 +131,16 @@ libretro-build-ios-arm64:
|
|||
- .libretro-ios-cmake-arm64
|
||||
- .core-defs
|
||||
variables:
|
||||
CORE_ARGS: -DBUILD_LIBRETRO_CORE=ON -DBUILD_PLAY=OFF -DENABLE_AMAZON_S3=off -DBUILD_TESTS=OFF -DCMAKE_TOOLCHAIN_FILE=deps/Dependencies/cmake-ios/ios.cmake -DTARGET_IOS=ON
|
||||
CORE_ARGS: $BASE_CORE_ARGS -DCMAKE_TOOLCHAIN_FILE=deps/Dependencies/cmake-ios/ios.cmake -DTARGET_IOS=ON
|
||||
LIBNAME: ${CORENAME}_libretro_ios.dylib
|
||||
|
||||
# tvOS
|
||||
libretro-build-tvos-arm64:
|
||||
extends:
|
||||
- .libretro-tvos-cmake-arm64
|
||||
- .core-defs
|
||||
variables:
|
||||
CORE_ARGS: $BASE_CORE_ARGS -DIOS_PLATFORM=TVOS -DCMAKE_TOOLCHAIN_FILE=deps/Dependencies/cmake-ios/ios.cmake -DTARGET_IOS=ON
|
||||
LIBNAME: ${CORENAME}_libretro_tvos.dylib
|
||||
|
||||
################################### CONSOLES #################################
|
||||
|
|
|
@ -29,6 +29,10 @@
|
|||
#error Unsupported CPU architecture
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_TV
|
||||
#define DISABLE_PROTECTION
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
static CEeExecutor* g_eeExecutor = nullptr;
|
||||
|
@ -70,7 +74,7 @@ void CEeExecutor::AddExceptionHandler()
|
|||
sigemptyset(&sigAction.sa_mask);
|
||||
int result = sigaction(SIGSEGV, &sigAction, nullptr);
|
||||
assert(result >= 0);
|
||||
#elif defined(__APPLE__)
|
||||
#elif defined(__APPLE__) && !TARGET_OS_TV
|
||||
if(!m_running)
|
||||
{
|
||||
kern_return_t result = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &m_port);
|
||||
|
@ -90,7 +94,7 @@ void CEeExecutor::RemoveExceptionHandler()
|
|||
|
||||
#if defined(_WIN32)
|
||||
RemoveVectoredExceptionHandler(m_handler);
|
||||
#elif defined(__APPLE__)
|
||||
#elif defined(__APPLE__) && !TARGET_OS_TV
|
||||
m_running = false;
|
||||
m_handlerThread.join();
|
||||
#endif
|
||||
|
@ -103,7 +107,7 @@ void CEeExecutor::RemoveExceptionHandler()
|
|||
void CEeExecutor::AttachExceptionHandlerToThread()
|
||||
{
|
||||
//Only necessary for macOS and iOS since the handler is set on a thread basis
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__APPLE__) && !TARGET_OS_TV
|
||||
assert(m_running);
|
||||
|
||||
auto result = mach_port_insert_right(mach_task_self(), m_port, m_port, MACH_MSG_TYPE_MAKE_SEND);
|
||||
|
@ -272,7 +276,7 @@ void CEeExecutor::HandleExceptionInternal(int sigId, siginfo_t* sigInfo, void* b
|
|||
signal(SIGSEGV, SIG_DFL);
|
||||
}
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
#elif defined(__APPLE__) && !TARGET_OS_TV
|
||||
|
||||
void CEeExecutor::HandlerThreadProc()
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#define NOMINMAX
|
||||
#include <Windows.h>
|
||||
#elif defined(__APPLE__)
|
||||
#include <TargetConditionals.h>
|
||||
#include <mach/mach.h>
|
||||
#include <thread>
|
||||
#elif defined(__unix__)
|
||||
|
@ -56,7 +57,7 @@ private:
|
|||
#elif defined(__unix__) || defined(__ANDROID__)
|
||||
static void HandleException(int, siginfo_t*, void*);
|
||||
void HandleExceptionInternal(int, siginfo_t*, void*);
|
||||
#elif defined(__APPLE__)
|
||||
#elif defined(__APPLE__) && !TARGET_OS_TV
|
||||
void HandlerThreadProc();
|
||||
|
||||
mach_port_t m_port = MACH_PORT_NULL;
|
||||
|
|
|
@ -69,7 +69,11 @@ if(TARGET_PLATFORM_ANDROID)
|
|||
set_target_properties(play_libretro PROPERTIES SUFFIX "_android.so")
|
||||
endif()
|
||||
if(TARGET_PLATFORM_IOS)
|
||||
set_target_properties(play_libretro PROPERTIES SUFFIX "_ios.dylib")
|
||||
if(IOS_PLATFORM STREQUAL "TVOS")
|
||||
set_target_properties(play_libretro PROPERTIES SUFFIX "_tvos.dylib")
|
||||
else()
|
||||
set_target_properties(play_libretro PROPERTIES SUFFIX "_ios.dylib")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(play_libretro ${PROJECT_LIBS})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue