From 0e2995b30e86bf13e79e81cdf8c02ef44ad1f84f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Jul 2026 21:24:42 +0000 Subject: [PATCH] Fix iOS build: use CMAKE_BINARY_DIR for git-version.cpp so it stays at the build root --- Core/CMakeLists.txt | 6 +++--- b-ios.sh | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 86136cd4d9..58cbcc1d2a 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -691,7 +691,7 @@ add_library(Core STATIC ${CMAKE_SOURCE_DIR}/ext/riscv-disas.h ${CMAKE_SOURCE_DIR}/ext/loongarch-disasm.cpp ${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) @@ -793,11 +793,11 @@ endif() add_custom_command(OUTPUT something_that_never_exists 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 ${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 SKIP_AUTOMOC ON) add_dependencies(Core GitVersion) diff --git a/b-ios.sh b/b-ios.sh index 1fb0ff8c3e..629dc20152 100755 --- a/b-ios.sh +++ b/b-ios.sh @@ -8,7 +8,8 @@ mkdir -p build # For the final IPA & DEB file mkdir -p 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. -# 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 "#define PPSSPP_GIT_VERSION_NO_UPDATE 1" >> git-version.cpp # Generate exportOptions.plist for xcodebuild @@ -34,11 +35,6 @@ echo ' # 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) 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 #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"