Generate Xcode project which can support both iOS and iOS Simulator
This commit is contained in:
parent
2f03c1b147
commit
f3a33642f8
|
@ -21,6 +21,7 @@ if(APPLE)
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum macOS deployment version")
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum macOS deployment version")
|
||||||
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "")
|
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "")
|
||||||
endif()
|
endif()
|
||||||
|
set(ZLIB_LIBRARY "-lz" CACHE STRING "Use generic linker flag for Xcode to support multiple SDKs")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LIBRETRO)
|
if(LIBRETRO)
|
||||||
|
|
|
@ -36,10 +36,16 @@
|
||||||
#error Unsupported architecture
|
#error Unsupported architecture
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TARGET_IPHONE) && !defined(__aarch64__)
|
#if defined(__APPLE__)
|
||||||
|
#include "TargetConditionals.h"
|
||||||
|
#if defined(TARGET_OS_SIMULATOR)
|
||||||
// iOS simulator
|
// iOS simulator
|
||||||
#define TARGET_NO_REC
|
#define TARGET_NO_REC
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(TARGET_MAC) && HOST_CPU == CPU_ARM64
|
||||||
|
#define TARGET_ARM_MAC
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(TARGET_NO_REC)
|
#if defined(TARGET_NO_REC)
|
||||||
#define FEAT_SHREC DYNAREC_NONE
|
#define FEAT_SHREC DYNAREC_NONE
|
||||||
|
|
|
@ -51,8 +51,7 @@ int darw_printf(const char* Text,...);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TARGET_IPHONE
|
#ifndef TARGET_IPHONE
|
||||||
#if defined(__APPLE__) && defined(__MACH__) && HOST_CPU == CPU_ARM64
|
#if defined(TARGET_ARM_MAC)
|
||||||
#define TARGET_ARM_MAC
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
inline static void JITWriteProtect(bool enabled) {
|
inline static void JITWriteProtect(bool enabled) {
|
||||||
if (__builtin_available(macOS 11.0, *))
|
if (__builtin_available(macOS 11.0, *))
|
||||||
|
|
|
@ -323,6 +323,13 @@ static void updateAudioSession(Event event, void *)
|
||||||
}
|
}
|
||||||
settings.display.dpi = 160.f * scale;
|
settings.display.dpi = 160.f * scale;
|
||||||
initRenderApi();
|
initRenderApi();
|
||||||
|
#if defined(TARGET_OS_SIMULATOR) && HOST_CPU == CPU_ARM64
|
||||||
|
if (config::RendererType.get() == RenderType::OpenGL)
|
||||||
|
{
|
||||||
|
NSLog(@"🚨🚨🚨 OpenGL renderer is not supported in Apple Silicon Mac 🚨🚨🚨\n");
|
||||||
|
raise(SIGTRAP);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
mainui_init();
|
mainui_init();
|
||||||
|
|
||||||
[self altKitStart];
|
[self altKitStart];
|
||||||
|
|
|
@ -6,7 +6,11 @@ echo "2) iOS"
|
||||||
read -p "Choose your target platform: " x
|
read -p "Choose your target platform: " x
|
||||||
|
|
||||||
if [ $x -eq 2 ]; then
|
if [ $x -eq 2 ]; then
|
||||||
option="-DCMAKE_SYSTEM_NAME=iOS"
|
if [ "$(uname -m)" = "arm64" ]; then
|
||||||
|
option="-DCMAKE_SYSTEM_NAME=iOS"
|
||||||
|
else
|
||||||
|
option="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64"
|
||||||
|
fi
|
||||||
lldbinitfolder="emulator-ios"
|
lldbinitfolder="emulator-ios"
|
||||||
echo 'Building iOS xcodeproj for debugging'
|
echo 'Building iOS xcodeproj for debugging'
|
||||||
echo 'Remove CODE_SIGNING_ALLOWED=NO in Build Settings if you are using your Apple Developer Certificate for signing'
|
echo 'Remove CODE_SIGNING_ALLOWED=NO in Build Settings if you are using your Apple Developer Certificate for signing'
|
||||||
|
|
Loading…
Reference in New Issue