Merge pull request #1001 from unknownbrackets/ios

iOS fixes: debugging and logging
This commit is contained in:
Henrik Rydgård 2013-03-16 01:23:51 -07:00
commit a219b33e1e
4 changed files with 42 additions and 11 deletions

View File

@ -1000,16 +1000,40 @@ file(INSTALL ${NativeAssets} DESTINATION assets)
# packaging and code signing
if (IOS)
# Fix CMake breaking optimization settings.
set(CMAKE_CXX_FLAGS_DEBUG "-g -D_DEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -D_NDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -D_NDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -D_NDEBUG")
set(CMAKE_C_FLAGS_DEBUG "-g -D_DEBUG")
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -D_NDEBUG")
set(CMAKE_C_FLAGS_RELEASE "-O2 -D_NDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -D_NDEBUG")
# These can be fast.
set_target_properties(cityhash PROPERTIES COMPILE_FLAGS "-O3")
set_target_properties(zlib PROPERTIES COMPILE_FLAGS "-O3")
add_dependencies(PPSSPP ${CoreLibName} GPU Common native)
file(GLOB IOSAssets ios/assets/*.png)
file(INSTALL
${IOSAssets}
DESTINATION assets)
file(INSTALL ${IOSAssets} DESTINATION assets)
file(INSTALL flash0 DESTINATION assets)
if (IOS_DEBUG)
file(INSTALL pspautotests DESTINATION assets)
endif()
set(RSRC_XIB_FILES assets/Icon@2x.png)
SET_SOURCE_FILES_PROPERTIES(${RSRC_XIB_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_source_files_properties(${RSRC_XIB_FILES}
PROPERTIES MACOSX_PACKAGE_LOCATION Resources
)
set(APP_DIR_NAME \${TARGET_BUILD_DIR}/\${FULL_PRODUCT_NAME})
add_custom_command(TARGET PPSSPP POST_BUILD
COMMAND tar -c -C . --exclude .DS_Store --exclude .git -H `find assets` | tar -x -C '${APP_DIR_NAME}'
COMMAND tar -c -C . --exclude .DS_Store --exclude .git -H assets | tar -x -C '${APP_DIR_NAME}'
)
# Force Xcode to relink the binary.
add_custom_command(TARGET Core PRE_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND rm -f PPSSPP.build/{Debug,Release,MinSizeRel,RelWithDebInfo}-iphoneos/PPSSPP.build/Objects-normal/*/PPSSPP {Debug,Release,MinSizeRel,RelWithDebInfo}-iphoneos/PPSSPP.app/PPSSPP
)
set_target_properties(${TargetBin} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "../ios/PPSSPP-Info.plist"

View File

@ -72,7 +72,7 @@ LogManager::LogManager()
m_Log[LogTypes::ME] = new LogContainer("ME", "Media Engine");
// Remove file logging on small devices
#ifndef USING_GLES2
#if !defined(USING_GLES2) || defined(_DEBUG)
m_fileLog = new FileLogListener(File::GetUserPath(F_MAINLOG_IDX).c_str());
m_consoleLog = new ConsoleListener();
m_debuggerLog = new DebuggerLogListener();
@ -85,7 +85,7 @@ LogManager::LogManager()
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
{
m_Log[i]->SetEnable(true);
#ifndef USING_GLES2
#if !defined(USING_GLES2) || defined(_DEBUG)
m_Log[i]->AddListener(m_fileLog);
m_Log[i]->AddListener(m_consoleLog);
#ifdef _MSC_VER
@ -100,7 +100,7 @@ LogManager::~LogManager()
{
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
{
#ifndef USING_GLES2
#if !defined(USING_GLES2) || defined(_DEBUG)
if (m_fileLog != NULL)
m_logManager->RemoveListener((LogTypes::LOG_TYPE)i, m_fileLog);
m_logManager->RemoveListener((LogTypes::LOG_TYPE)i, m_consoleLog);
@ -114,7 +114,7 @@ LogManager::~LogManager()
delete m_Log[i];
if (m_fileLog != NULL)
delete m_fileLog;
#ifndef USING_GLES2
#if !defined(USING_GLES2) || defined(_DEBUG)
delete m_consoleLog;
delete m_debuggerLog;
#endif

View File

@ -171,6 +171,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co
VFSRegister("", new DirectoryAssetReader("app/native/assets/"));
#elif defined(IOS)
VFSRegister("", new DirectoryAssetReader(external_directory));
user_data_path += "/";
#else
VFSRegister("", new DirectoryAssetReader("assets/"));
#endif

View File

@ -71,14 +71,20 @@ void RunTests()
coreParam.useMediaEngine = false;
coreParam.collectEmuLog = &output;
#ifdef IOS
std::string baseDirectory = g_Config.flashDirectory + "../";
#else
std::string baseDirectory = g_Config.memCardDirectory;
#endif
// Never report from tests.
std::string savedReportHost = g_Config.sReportHost;
g_Config.sReportHost = "";
for (int i = 0; i < ARRAY_SIZE(testsToRun); i++) {
const char *testName = testsToRun[i];
coreParam.fileToStart = g_Config.memCardDirectory + "pspautotests/tests/" + testName + ".prx";
std::string expectedFile = g_Config.memCardDirectory + "pspautotests/tests/" + testName + ".expected";
coreParam.fileToStart = baseDirectory + "pspautotests/tests/" + testName + ".prx";
std::string expectedFile = baseDirectory + "pspautotests/tests/" + testName + ".expected";
ILOG("Preparing to execute %s", testName)
std::string error_string;