mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 13:47: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
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
CORENAME: play
|
CORENAME: play
|
||||||
API_LEVEL: 19
|
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
|
EXTRA_PATH: Source/ui_libretro
|
||||||
|
|
||||||
.core-defs-win:
|
.core-defs-win:
|
||||||
|
@ -48,6 +49,10 @@ include:
|
||||||
- project: 'libretro-infrastructure/ci-templates'
|
- project: 'libretro-infrastructure/ci-templates'
|
||||||
file: '/ios-cmake.yml'
|
file: '/ios-cmake.yml'
|
||||||
|
|
||||||
|
# tvOS
|
||||||
|
- project: 'libretro-infrastructure/ci-templates'
|
||||||
|
file: '/tvos-cmake.yml'
|
||||||
|
|
||||||
# Stages for building
|
# Stages for building
|
||||||
stages:
|
stages:
|
||||||
- build-prepare
|
- build-prepare
|
||||||
|
@ -126,7 +131,16 @@ libretro-build-ios-arm64:
|
||||||
- .libretro-ios-cmake-arm64
|
- .libretro-ios-cmake-arm64
|
||||||
- .core-defs
|
- .core-defs
|
||||||
variables:
|
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
|
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 #################################
|
################################### CONSOLES #################################
|
||||||
|
|
|
@ -29,6 +29,10 @@
|
||||||
#error Unsupported CPU architecture
|
#error Unsupported CPU architecture
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if TARGET_OS_TV
|
||||||
|
#define DISABLE_PROTECTION
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static CEeExecutor* g_eeExecutor = nullptr;
|
static CEeExecutor* g_eeExecutor = nullptr;
|
||||||
|
@ -70,7 +74,7 @@ void CEeExecutor::AddExceptionHandler()
|
||||||
sigemptyset(&sigAction.sa_mask);
|
sigemptyset(&sigAction.sa_mask);
|
||||||
int result = sigaction(SIGSEGV, &sigAction, nullptr);
|
int result = sigaction(SIGSEGV, &sigAction, nullptr);
|
||||||
assert(result >= 0);
|
assert(result >= 0);
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__) && !TARGET_OS_TV
|
||||||
if(!m_running)
|
if(!m_running)
|
||||||
{
|
{
|
||||||
kern_return_t result = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &m_port);
|
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)
|
#if defined(_WIN32)
|
||||||
RemoveVectoredExceptionHandler(m_handler);
|
RemoveVectoredExceptionHandler(m_handler);
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__) && !TARGET_OS_TV
|
||||||
m_running = false;
|
m_running = false;
|
||||||
m_handlerThread.join();
|
m_handlerThread.join();
|
||||||
#endif
|
#endif
|
||||||
|
@ -103,7 +107,7 @@ void CEeExecutor::RemoveExceptionHandler()
|
||||||
void CEeExecutor::AttachExceptionHandlerToThread()
|
void CEeExecutor::AttachExceptionHandlerToThread()
|
||||||
{
|
{
|
||||||
//Only necessary for macOS and iOS since the handler is set on a thread basis
|
//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);
|
assert(m_running);
|
||||||
|
|
||||||
auto result = mach_port_insert_right(mach_task_self(), m_port, m_port, MACH_MSG_TYPE_MAKE_SEND);
|
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);
|
signal(SIGSEGV, SIG_DFL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__) && !TARGET_OS_TV
|
||||||
|
|
||||||
void CEeExecutor::HandlerThreadProc()
|
void CEeExecutor::HandlerThreadProc()
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
|
#include <TargetConditionals.h>
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#elif defined(__unix__)
|
#elif defined(__unix__)
|
||||||
|
@ -56,7 +57,7 @@ private:
|
||||||
#elif defined(__unix__) || defined(__ANDROID__)
|
#elif defined(__unix__) || defined(__ANDROID__)
|
||||||
static void HandleException(int, siginfo_t*, void*);
|
static void HandleException(int, siginfo_t*, void*);
|
||||||
void HandleExceptionInternal(int, siginfo_t*, void*);
|
void HandleExceptionInternal(int, siginfo_t*, void*);
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__) && !TARGET_OS_TV
|
||||||
void HandlerThreadProc();
|
void HandlerThreadProc();
|
||||||
|
|
||||||
mach_port_t m_port = MACH_PORT_NULL;
|
mach_port_t m_port = MACH_PORT_NULL;
|
||||||
|
|
|
@ -69,8 +69,12 @@ if(TARGET_PLATFORM_ANDROID)
|
||||||
set_target_properties(play_libretro PROPERTIES SUFFIX "_android.so")
|
set_target_properties(play_libretro PROPERTIES SUFFIX "_android.so")
|
||||||
endif()
|
endif()
|
||||||
if(TARGET_PLATFORM_IOS)
|
if(TARGET_PLATFORM_IOS)
|
||||||
|
if(IOS_PLATFORM STREQUAL "TVOS")
|
||||||
|
set_target_properties(play_libretro PROPERTIES SUFFIX "_tvos.dylib")
|
||||||
|
else()
|
||||||
set_target_properties(play_libretro PROPERTIES SUFFIX "_ios.dylib")
|
set_target_properties(play_libretro PROPERTIES SUFFIX "_ios.dylib")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(play_libretro ${PROJECT_LIBS})
|
target_link_libraries(play_libretro ${PROJECT_LIBS})
|
||||||
set_target_properties(play_libretro PROPERTIES PREFIX "")
|
set_target_properties(play_libretro PROPERTIES PREFIX "")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue