Fix iOS build: use CMAKE_BINARY_DIR for git-version.cpp so it stays at the build root

This commit is contained in:
copilot-swe-agent[bot] authored and Henrik Rydgård committed 2026-07-24 23:25:32 +02:00
1 parent d959ef72b1
commit 0e2995b30e
2 files changed
+5 -9

No files matched your search

+3 -3
View File
@@ -691,7 +691,7 @@ add_library(Core STATIC
${CMAKE_SOURCE_DIR}/ext/riscv-disas.h ${CMAKE_SOURCE_DIR}/ext/riscv-disas.h
${CMAKE_SOURCE_DIR}/ext/loongarch-disasm.cpp ${CMAKE_SOURCE_DIR}/ext/loongarch-disasm.cpp
${CMAKE_SOURCE_DIR}/ext/loongarch-disasm.h ${CMAKE_SOURCE_DIR}/ext/loongarch-disasm.h
${CMAKE_CURRENT_BINARY_DIR}/git-version.cpp ${CMAKE_BINARY_DIR}/git-version.cpp
) )
if((MACOSX OR IOS) AND NOT LIBRETRO) if((MACOSX OR IOS) AND NOT LIBRETRO)
@@ -793,11 +793,11 @@ endif()
add_custom_command(OUTPUT something_that_never_exists add_custom_command(OUTPUT something_that_never_exists
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_SOURCE_DIR} COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_SOURCE_DIR}
-DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR} -DOUTPUT_DIR=${CMAKE_BINARY_DIR}
-P ${CMAKE_SOURCE_DIR}/git-version.cmake -P ${CMAKE_SOURCE_DIR}/git-version.cmake
${WIN_VERSION_CMD}) ${WIN_VERSION_CMD})
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/git-version.cpp set_source_files_properties(${CMAKE_BINARY_DIR}/git-version.cpp
PROPERTIES GENERATED TRUE PROPERTIES GENERATED TRUE
SKIP_AUTOMOC ON) SKIP_AUTOMOC ON)
add_dependencies(Core GitVersion) add_dependencies(Core GitVersion)
+2 -6
View File
@@ -8,7 +8,8 @@ mkdir -p build # For the final IPA & DEB file
mkdir -p build-ios mkdir -p build-ios
cd build-ios cd build-ios
rm -rf PPSSPP.app # There seems to be an existing symlink, may be from ccache? We don't want to include old stuff that might be removed to be included in the final IPA file. rm -rf PPSSPP.app # There seems to be an existing symlink, may be from ccache? We don't want to include old stuff that might be removed to be included in the final IPA file.
# It seems xcodebuild is looking for "git-version.cpp" file inside "build-ios" directory instead of at repo's root dir. # git-version.cpp is listed as a source file at ${CMAKE_BINARY_DIR}/git-version.cpp,
# so we pre-create it here so Xcode can find it before any script phases run.
echo "const char *PPSSPP_GIT_VERSION = \"$(git describe --always)\";" > git-version.cpp echo "const char *PPSSPP_GIT_VERSION = \"$(git describe --always)\";" > git-version.cpp
echo "#define PPSSPP_GIT_VERSION_NO_UPDATE 1" >> git-version.cpp echo "#define PPSSPP_GIT_VERSION_NO_UPDATE 1" >> git-version.cpp
# Generate exportOptions.plist for xcodebuild # Generate exportOptions.plist for xcodebuild
@@ -34,11 +35,6 @@ echo '<?xml version="1.0" encoding="UTF-8"?>
# There are 2 ways to build PPSSPP for iOS, using make or xcodebuild # There are 2 ways to build PPSSPP for iOS, using make or xcodebuild
# Generate xcodeproject (only needed when building using xcode, similar to ./b.sh --ios-xcode) # Generate xcodeproject (only needed when building using xcode, similar to ./b.sh --ios-xcode)
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/ios.cmake -GXcode .. cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/ios.cmake -GXcode ..
# Xcode's new build system validates that source files exist before running script phases.
# CMake places git-version.cpp at Core/git-version.cpp (CMAKE_CURRENT_BINARY_DIR for Core/).
# Copy the pre-created git-version.cpp so Xcode can find it.
mkdir -p Core
cp git-version.cpp Core/git-version.cpp
# Build PPSSPP using xcode # Build PPSSPP using xcode
#xcodebuild clean build -project PPSSPP.xcodeproj CODE_SIGNING_ALLOWED=NO -sdk iphoneos -configuration Release #xcodebuild clean build -project PPSSPP.xcodeproj CODE_SIGNING_ALLOWED=NO -sdk iphoneos -configuration Release
xcodebuild -project PPSSPP.xcodeproj -scheme PPSSPP -sdk iphoneos -configuration Release -quiet clean build archive -archivePath ./build/PPSSPP.xcarchive CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO #CODE_SIGN_IDENTITY="iPhone Distribution: Your NAME / Company (TeamID)" #PROVISIONING_PROFILE="xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" xcodebuild -project PPSSPP.xcodeproj -scheme PPSSPP -sdk iphoneos -configuration Release -quiet clean build archive -archivePath ./build/PPSSPP.xcarchive CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO #CODE_SIGN_IDENTITY="iPhone Distribution: Your NAME / Company (TeamID)" #PROVISIONING_PROFILE="xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"