Repository navigation
fix(build): CMake defines _PSP_FW_VERSION; samples build together - #161
Merged
Merged
Conversation
The code tests _PSP_FW_VERSION (savedata's key, in all 7 dialogs), which the PSPSDK's build.mak defines for Make builds; cmake/PSP.cmake defined PSP_FW_VERSION instead. The same source then built two libraries: in the CMake one, oslSetSavedataKey and its calls were compiled out. PSP.cmake now defines both. Third-party sources keep it undefined, as the Makefile's CFLAGS_THIRD_PARTY does: intraFont's libccc has an sceIo path under #ifdef _PSP_FW_VERSION that neither build uses (its error check tests _PSP, which nothing defines). Preprocessed src/saveload.c: oslSetSavedataKey() appears 8 times with Make, 0 with CMake on master, 8 now. Comparing the symbols of all 102 objects between the two builds, the rest only differ in functions that CMake's -O3 inlines.
Every sample put its executable, PARAM.SFO, EBOOT.PBP and assets in CMAKE_BINARY_DIR. Built one at a time that is the sample's own build directory, but samples/CMakeLists.txt builds them all in one tree: the 13 samples overwrote each other's EBOOT.PBP (one left at the end), and on macOS's case-insensitive filesystem the helloworld executable collides with the helloWorld/ directory. They now use CMAKE_CURRENT_BINARY_DIR, which is the same directory when a sample is built alone. The combined build now gives 13 EBOOT.PBP, one per sample directory, and nothing at the top; building helloWorld and map alone still puts EBOOT.PBP in their cbuild/. CI builds the samples together too and checks there is one EBOOT.PBP per sample (its macOS runners cover the case-insensitive case).
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc77000877
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Each sample copies every non-source entry of its directory next to its EBOOT.PBP, build directories included. A sample built alone has its build tree (cbuild/) inside that directory, so every rebuild copied it into itself (cbuild/cbuild/cbuild/EBOOT.PBP, ELFs and CMakeFiles included), and the combined build copied each standalone build into its own output. That is why the new CI check counted 39 EBOOT.PBP for 13 samples on every runner; reported by the Codex review on #161. The copy now skips directories holding a CMakeCache.txt and the build directory itself (no cache yet on the first configure). The CI check also counts only cbuild/<sample>/EBOOT.PBP. Running the workflow's two samples steps in a copy of the tree: 39 packages and 39 nested copies before, 13 and 0 now; audio rebuilt three times on its own keeps one EBOOT.PBP and still copies its Resources/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make and CMake now select the same savedata firmware path. The 13 sample CMake projects share linking, packaging and asset handling through
cmake/OSLibSample.cmake, with each executable and package written into its own build directory.PSP_FW_VERSION, while savedata tests_PSP_FW_VERSION_PSP_FW_VERSION=371, matching PSPSDK Make buildslibccc.cretains its existing stdio pathhelloWorld/on case-insensitive filesystemsCMAKE_CURRENT_BINARY_DIRfor each sample's executable and packageOSLibSample.cmake; retain each sample's library order and additional dependenciesrectAndFontsemitteddialogandshapesused the Hello World title.cppand.hppalongside existing source/build exclusionsThe branch incorporates master through
4ca7d2b, including the merged fixes from #155–160. The integration and additional build fixes are committed asa7f728d;94c75d5centralizes and standardizes the sample CMake projects.Evidence
Validation of the integrated tree:
helloWorldsample with a binary directory beneathbuild/debuggenerated a copy frombuildintobuild/debug/build. The PSP build failed with File name too long, exit 2, after creating about 270 MiB of recursive copies.After: the PSP toolchain successfully builds
audio/build/debug; its EBOOT exists, its BGM is byte-identical to the source, and no build parent or nested cache is copied into it.build/asset alongsidebuild-debug/, andResources/preservation. All 13 samples now use that guard through the shared helper.audio/build/debugbuild with the PSP toolchain. Actual PARAM.SFO and embedded EBOOT titles match all 13 expected titles. Executable names match directory names and case;rectAndFontsemitsrectAndFonts, andshapesis titledShapes Sample. C++ sources/headers are excluded from copied assets.saveload.c: one key helper and all seven calls.libccc.cpreprocessing is also equivalent and retains stdio.CI now builds the nested audio case before the aggregate build, checks package isolation, rejects copied CMake caches/build parents, and compares representative assets byte-for-byte. It also requires the
rectAndFontsexecutable, rejects its olddialogoutput, and rejects copied C++ sources/headers inshapes. YAML, shell syntax and contamination/corruption fixture checks pass.No examples or savedata compatibility tests were executed on a real PSP during this validation.
Merge Danger
Door: two-way
Blast Radius: CMake builds
cmake/PSP.cmakereceive the SDK-compatible firmware macro.