Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS CMake fixes and new --ios-xcode ./b.sh command. #13936

Merged
merged 1 commit into from
Jan 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if(ANDROID OR WIN32 OR (UNIX AND NOT ARM_NO_VULKAN))
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
if(NOT (ARM64 AND MACOSX))
if(NOT ((ARM64 AND MACOSX) OR IOS))
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/sdl)
endif()

Expand Down Expand Up @@ -198,7 +198,7 @@ if(USING_EGL)
set(OPENGL_LIBRARIES ${OPENGL_LIBRARIES} ${EGL_LIBRARIES})
endif()

if(NOT LIBRETRO)
if(NOT LIBRETRO AND NOT IOS)
find_package(SDL2)
endif()
include(FindThreads)
Expand Down Expand Up @@ -1037,7 +1037,7 @@ if(WIN32)
target_link_libraries(Common winmm d3d9 dsound)
endif()

if(TARGET SDL2::SDL2)
if(TARGET SDL2::SDL2 AND NOT IOS)
target_link_libraries(Common SDL2::SDL2)
endif()

Expand Down Expand Up @@ -2168,11 +2168,12 @@ if(IOS)
set_source_files_properties(${RSRC_XIB_FILES}
PROPERTIES MACOSX_PACKAGE_LOCATION Resources
)
if(CMAKE_GENERATOR STREQUAL "Xcode")
set(APP_DIR_NAME "$(TARGET_BUILD_DIR)/$(FULL_PRODUCT_NAME)")
else()
#This breaks in modern XCode. Not sure when it worked...
#if(CMAKE_GENERATOR STREQUAL "Xcode")
# set(APP_DIR_NAME "$(TARGET_BUILD_DIR)/$(FULL_PRODUCT_NAME)")
#else()
set(APP_DIR_NAME "$<TARGET_FILE_DIR:PPSSPP>")
endif()
#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}\"
Expand All @@ -2185,7 +2186,6 @@ if(IOS)
RESOURCE "ios/Settings.bundle"
RESOURCE "MoltenVK/iOS/Frameworks"
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET}
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "iPhone/iPad"
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
XCODE_ATTRIBUTE_ENABLE_BITCODE NO
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-"
Expand Down
3 changes: 3 additions & 0 deletions b.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ do
--ios) CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/ios.cmake ${CMAKE_ARGS}"
TARGET_OS=iOS
;;
--ios-xcode) CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/ios.cmake -DIOS_PLATFORM=OS -GXcode ${CMAKE_ARGS}"
TARGET_OS=iOS-xcode
;;
--rpi-armv6)
CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/raspberry.armv6.cmake ${CMAKE_ARGS}"
;;
Expand Down
1 change: 1 addition & 0 deletions ios/ViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ - (void)viewDidLoad {
GLKView* view = (GLKView *)self.view;
view.context = self.context;
view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
view.drawableStencilFormat = GLKViewDrawableStencilFormat8;
[EAGLContext setCurrentContext:self.context];
self.preferredFramesPerSecond = 60;

Expand Down