More build work

This commit is contained in:
Henrik Rydgård 2024-05-06 11:44:43 +02:00
parent 2df7a24748
commit 90f7a90aa8
5 changed files with 57 additions and 24 deletions

View File

@ -131,11 +131,14 @@ if(GOLD)
add_definitions(-DGOLD)
message("Gold Build")
else()
message("Normal Build")
message("Non-gold Build")
endif()
if(IOS_APP_STORE)
add_definitions(-DPPSSPP_PLATFORM_IOS_APP_STORE)
add_definitions(-DGLES_SILENCE_DEPRECATION)
# Set a global default to not generate schemes for each target.
# Makes using XCode sligthly more sane.
set(CMAKE_XCODE_GENERATE_SCHEME NO)
message("iOS App Store build")
else()
@ -1256,6 +1259,9 @@ add_library(basis_universal STATIC
ext/basis_universal/basisu_transcoder_tables_pvrtc2_alpha_33.inc
ext/basis_universal/basisu_transcoder_uastc.h
)
# Hack around a bad check for __GNUC__ that makes it use old stuff on iOS
target_compile_options(basis_universal PRIVATE "-Wno-deprecated-builtins")
set(BASISU_LIBRARIES basis_universal)
set(nativeExtra)
@ -2851,14 +2857,13 @@ if(IOS AND NOT LIBRETRO)
set(ICON_NAME "Icon")
set(PRODUCT_NAME "PPSSPP")
endif()
message(STATUS ${DEVELOPMENT_TEAM_ID})
message(STATUS ${ICON_NAME})
message(STATUS ${DEPLOYMENT_TARGET})
message(STATUS "DevTeam: ${DEVELOPMENT_TEAM_ID} Icon: ${ICON_NAME} Target: ${TargetBin}")
# This is for injecting the version into the plist.
add_custom_command(TARGET ${TargetBin} 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 /bin/bash "${CMAKE_SOURCE_DIR}/ios/macbundle.sh" \"${APP_DIR_NAME}\"
#COMMAND mkdir -p \"${APP_DIR_NAME}\"
# This tar command seems questionable? It seems to just copy png files, we already have steps for that?
COMMAND tar -c -C ${CMAKE_CURRENT_BINARY_DIR} --exclude .DS_Store --exclude .git assets *.png | tar -x -C -v \"${APP_DIR_NAME}\"
COMMAND /bin/bash "${CMAKE_SOURCE_DIR}/ios/iosbundle.sh" \"${APP_DIR_NAME}\"
)
# https://stackoverflow.com/questions/40664125/cmake-and-code-signing-in-xcode-8-for-ios-projects
set_target_properties(${TargetBin} PROPERTIES
@ -2869,22 +2874,11 @@ if(IOS AND NOT LIBRETRO)
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ${BUNDLE_IDENTIFIER}
XCODE_ATTRIBUTE_PRODUCT_NAME ${PRODUCT_NAME}
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME ${ICON_NAME}
BUILD_WITH_INSTALL_RPATH YES
MACOSX_BUNDLE_INFO_PLIST ${BUNDLE_PLIST}
# Some sources say we should generate the PLIST. There's stuff in it that
# I don't know how to generate, though.
#XCODE_ATTRIBUTE_GENERATE_INFOPLIST_FILE "YES"
##XCODE_ATTRIBUTE_INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
#XCODE_ATTRIBUTE_INFOPLIST_KEY_CFBundleDisplayName "PPSSPP"
#XCODE_ATTRIBUTE_INFOPLIST_KEY_NSHumanReadableCopyright "(c)2024 PPSSPP Project"
#XCODE_ATTRIBUTE_INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"
#XCODE_ATTRIBUTE_INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"
#XCODE_ATTRIBUTE_INFOPLIST_KEY_NSLocationWhenInUseUsageDescription "Your location may be used to emulate Go!Explore, a GPS accessory"
#XCODE_ATTRIBUTE_INFOPLIST_KEY_NSCameraUsageDescription "Your camera may be used to emulate Go!Cam, a camera accessory"
#XCODE_ATTRIBUTE_INFOPLIST_KEY_NSMicrophoneUsageDescription "Your microphone may be used to emulate Go!Cam/Talkman, a microphone accessory"
#XCODE_ATTRIBUTE_INFOPLIST_KEY_UILaunchImageFile "Default.png"
#UIFileSharingEnabled and LSSupportsOpeningDocumentsInPlace
#XCODE_ATTRIBUTE_INFOPLIST_KEY_UIStatusBarHidden YES
#XCODE_ATTRIBUTE_INFOPLIST_KEY_UIViewControllerBasedStatusBarAppearance YES
#XCODE_ATTRIBUTE_INFOPLIST_KEY_UIRequiredDeviceCapabilities arm64
XCODE_ATTRIBUTE_INFOPLIST_KEY_UIFileSharingEnabled YES
XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY YES

View File

@ -8,6 +8,11 @@ if [ ! -f "${PPSSPPQt}" ]; then
exit 0
fi
GIT_VERSION_LINE=$(grep "PPSSPP_GIT_VERSION = " "$(dirname "${0}")/../git-version.cpp")
echo "Running Qt macbundle.sh for $PPSSPP/Contents/Info.plist ($GIT_VERSION_LINE)"
# Why don't we just put these in the template?
plutil -replace NSPrincipalClass -string NSApplication ${PPSSPP}/Contents/Info.plist
plutil -replace NSHighResolutionCapable -bool YES ${PPSSPP}/Contents/Info.plist
@ -15,7 +20,6 @@ plutil -replace NSLocationWhenInUseUsageDescription -string "Your location may b
plutil -replace NSCameraUsageDescription -string "Your camera may be used to emulate Go!Cam, a camera accessory" ${PPSSPP}/Contents/Info.plist
plutil -replace NSMicrophoneUsageDescription -string "Your microphone may be used to emulate Go!Cam/Talkman, a microphone accessory" ${PPSSPP}/Contents/Info.plist
GIT_VERSION_LINE=$(grep "PPSSPP_GIT_VERSION = " "$(dirname "${0}")/../git-version.cpp")
SHORT_VERSION_MATCH='.*"v([0-9\.]+(-[0-9]+)?).*";'
LONG_VERSION_MATCH='.*"v(.*)";'
if [[ "${GIT_VERSION_LINE}" =~ ^${SHORT_VERSION_MATCH}$ ]]; then

View File

@ -1,6 +1,6 @@
#!/bin/bash
echo "Hello from macbundle.sh"
echo "SDL macbundle.sh"
PPSSPP="${1}"
PPSSPP_SHORTNAME="${2}"

View File

@ -30,9 +30,6 @@ pushd $FOLDER_NAME
BUILD_TYPE=Release
echo $DEVTEAM
echo $BUILD_TYPE
cmake .. -DIOS_APP_STORE=ON -DGOLD=$GOLD -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/ios.cmake -DDEVELOPMENT_TEAM_ID=${DEVTEAM} -DIOS_PLATFORM=OS -GXcode
# TODO: Get a MoltenVK somewhere.
#cp ../MoltenVK/iOS/Frameworks/libMoltenVK.dylib PPSSPP.app/Frameworks

38
ios/iosbundle.sh Normal file
View File

@ -0,0 +1,38 @@
#!/bin/bash
echo "iosbundle.sh params 0: ${0} 1: ${1} 2: ${2}"
PPSSPP="${1}"
PPSSPPiOS="${PPSSPP}/PPSSPP"
if [ ! -f "${PPSSPPiOS}" ]; then
echo "iosbundle.sh: No such file: ${PPSSPPiOS}!"
exit 0
fi
GIT_VERSION_FILE="${1}/../../git-version.cpp"
if [ ! -f "${GIT_VERSION_FILE}" ]; then
echo "iosbundle.sh: No git-version.cpp file: ${GIT_VERSION_FILE}"
exit 0
fi
echo "GIT_VERSION_FILE: ${GIT_VERSION_FILE}"
GIT_VERSION_LINE=$(grep "PPSSPP_GIT_VERSION = " $GIT_VERSION_FILE)
SHORT_VERSION_MATCH='.*"v([0-9\.]+(-[0-9]+)?).*";'
LONG_VERSION_MATCH='.*"v(.*)";'
SHORT_VERSION=$(echo ${GIT_VERSION_LINE} | perl -pe "s/${SHORT_VERSION_MATCH}/\$1/g")
LONG_VERSION=$(echo ${GIT_VERSION_LINE} | perl -pe "s/${LONG_VERSION_MATCH}/\$1/g")
echo "Writing versions to Info.plist. Short, long: $SHORT_VERSION , $LONG_VERSION"
if [[ "${GIT_VERSION_LINE}" =~ ^${SHORT_VERSION_MATCH}$ ]]; then
plutil -replace CFBundleShortVersionString -string $SHORT_VERSION ${PPSSPP}/Info.plist
plutil -replace CFBundleVersion -string $LONG_VERSION ${PPSSPP}/Info.plist
else
plutil -replace CFBundleShortVersionString -string "" ${PPSSPP}/Info.plist
plutil -replace CFBundleVersion -string "" ${PPSSPP}/Info.plist
fi
echo "iosbundle.sh: Updated ${PPSSPP}/Info.plist"