From 2a3c4408d2047e872e3c13f38027a801633da003 Mon Sep 17 00:00:00 2001 From: Kentucky Compass Date: Sat, 30 Dec 2017 20:14:07 -0800 Subject: [PATCH 1/3] Fix build on iOS (only iOS 9 and up support thread_local) --- ext/native/profiler/profiler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/native/profiler/profiler.cpp b/ext/native/profiler/profiler.cpp index 35e270b477..811b78d7bf 100644 --- a/ext/native/profiler/profiler.cpp +++ b/ext/native/profiler/profiler.cpp @@ -15,7 +15,12 @@ #define MAX_CATEGORIES 64 // Can be any number, represents max profiled names. #define MAX_DEPTH 16 // Can be any number, represents max nesting depth of profiled names. +#if PPSSPP_PLATFORM(IOS) && defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 +// iOS did not support C++ thread_local before iOS 9 +#define MAX_THREADS 1 // Can be any number, represents concurrent threads calling the profiler. +#else #define MAX_THREADS 4 // Can be any number, represents concurrent threads calling the profiler. +#endif #define HISTORY_SIZE 128 // Must be power of 2 #ifndef _DEBUG From bcd19ee520fd133d4b3a1f3a6432db0909a96236 Mon Sep 17 00:00:00 2001 From: Kentucky Compass Date: Sat, 30 Dec 2017 20:16:00 -0800 Subject: [PATCH 2/3] fix cmake when building for iOS in a path with spaces --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b85ea12643..c1f97ff0e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1891,8 +1891,8 @@ if(IOS) set(APP_DIR_NAME "$") endif() add_custom_command(TARGET PPSSPP POST_BUILD - COMMAND mkdir -p ${APP_DIR_NAME} - COMMAND tar -c -C ${CMAKE_CURRENT_BINARY_DIR} --exclude .DS_Store --exclude .git assets *.png | tar -x -C ${APP_DIR_NAME} + COMMAND mkdir -p \"${APP_DIR_NAME}\" + COMMAND tar -c -C ${CMAKE_CURRENT_BINARY_DIR} --exclude .DS_Store --exclude .git assets *.png | tar -x -C \"${APP_DIR_NAME}\" ) set_target_properties(${TargetBin} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/ios/PPSSPP-Info.plist" From 6a9a511337023c989f4837201d25718d5c7906f0 Mon Sep 17 00:00:00 2001 From: Kentucky Compass Date: Sat, 30 Dec 2017 22:44:41 -0800 Subject: [PATCH 3/3] add an include for PPSSPP_PLATFORM --- ext/native/profiler/profiler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/native/profiler/profiler.cpp b/ext/native/profiler/profiler.cpp index 811b78d7bf..bf037a9510 100644 --- a/ext/native/profiler/profiler.cpp +++ b/ext/native/profiler/profiler.cpp @@ -11,6 +11,7 @@ #include "base/logging.h" #include "base/timeutil.h" #include "gfx_es2/draw_buffer.h" +#include "ppsspp_config.h" #include "profiler/profiler.h" #define MAX_CATEGORIES 64 // Can be any number, represents max profiled names.