iOS Support

Preliminary iOS support using new framework.
This commit is contained in:
Sacha 2012-11-26 14:06:35 +10:00
parent 3c903dda24
commit 5019462317
5 changed files with 40 additions and 19 deletions

View File

@ -1,14 +1,14 @@
cmake_minimum_required(VERSION 2.8.8)
project(PPSSPP)
if(ANDROID OR BLACKBERRY OR APPLE)
set(HEADLESS OFF)
elseif(NOT DEFINED HEADLESS)
set(HEADLESS ON)
if(ANDROID)
if(ARMEABI OR ARMEABI_V7A)
set(ARM ON)
endif()
endif()
if(ANDROID_ABI)
if(ARMEABI OR ARMEABI_V7A)
if (IOS)
if (${IOS_PLATFORM} STREQUAL "OS")
set(ARM ON)
endif()
endif()
@ -23,11 +23,18 @@ else() # Assume x86
set(X86 ON)
endif()
if(ARM OR APPLE)
set(HEADLESS OFF)
elseif(NOT DEFINED HEADLESS)
set(HEADLESS ON)
endif()
# User-editable options (go into CMakeCache.txt)
option(ARM "Set to ON if targeting an ARM processor" ${ARM})
option(X86 "Set to ON if targeting an X86 processor" ${X86})
option(ANDROID "Set to ON if targeting an Android device" ${ANDROID})
option(BLACKBERRY "Set to ON if targeting a Blackberry device" ${BLACKBERRY})
option(IOS "Set to ON if targeting an iOS device" ${IOS})
option(USING_GLES2 "Set to ON if target device uses OpenGL ES 2.0" ${USING_GLES2})
option(HEADLESS "Set to OFF to not generate the PPSSPPHeadless target" ${HEADLESS})
@ -40,6 +47,15 @@ if(ANDROID)
endif()
set(CoreLibName ppsspp_jni)
set(CoreLinkType SHARED)
elseif(IOS)
if (NOT IOS_PLATFORM)
message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE was not set!\n"
"Delete the CMakeCache.txt file and CMakeFiles directory."
"Rerun ${CMAKE_COMMAND} with \"-DCMAKE_TOOLCHAIN_FILE"
"=${CMAKE_SOURCE_DIR}/ios/ios.toolchain.cmake\"")
endif()
set(CoreLibName Core)
set(CoreLinkType STATIC)
else()
set(CoreLibName Core)
set(CoreLinkType STATIC)
@ -68,6 +84,10 @@ if(ANDROID)
add_definitions(-DANDROID)
endif()
if(IOS)
add_definitions(-DIOS)
endif()
if(ARM)
add_definitions(-DARM)
endif()
@ -820,6 +840,8 @@ if(SDL_FOUND)
target_link_libraries(PPSSPPBlackberry ${LinkCommon} bps screen socket EGL GLESv2)
elseif(ANDROID)
# no target
elseif(IOS)
# no target
else()
set(SDL_Main native/base/PCMain.cpp)
if(APPLE)

View File

@ -25,6 +25,10 @@
#define SLEEP(x) usleep(x*1000)
#endif
#ifdef IOS
#include <signal.h>
#endif
template <bool> struct CompileTimeAssert;
template<> struct CompileTimeAssert<true> {};

View File

@ -1,6 +1,10 @@
#if defined(USING_GLES2)
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#elif defined(IOS)
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
typedef char GLchar;
#else
#include <GL/glew.h>
#if defined(__APPLE__)

View File

@ -19,6 +19,10 @@
#if defined(USING_GLES2)
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#elif defined(IOS)
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
typedef char GLchar;
#else
#include <GL/glew.h>
#if defined(__APPLE__)

View File

@ -15,19 +15,6 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#if defined(USING_GLES2)
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#else
#include <GL/glew.h>
#if defined(__APPLE__)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
#endif
#include "../../Core/MemMap.h"
#include "../../Core/Host.h"