Resolve sibling component paths relative to the current directory - #205
Open
Sinan-Karakaya wants to merge 1 commit into
Open
Resolve sibling component paths relative to the current directory#205Sinan-Karakaya wants to merge 1 commit into
Sinan-Karakaya wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes configuration failures when ps2xRecomp and ps2xAnalyzer are consumed via add_subdirectory() by resolving sibling component paths relative to the component directory (instead of the top-level build’s CMAKE_SOURCE_DIR).
Changes:
- Update
ps2xRecompto includeps2xRuntime/cmake/ReleaseMode.cmakevia aCMAKE_CURRENT_SOURCE_DIR-relative path. - Update
ps2xAnalyzerto referenceps2xRecompandps2xRuntimeheaders viaCMAKE_CURRENT_SOURCE_DIR-relative paths. - Update
ps2xAnalyzerto includeps2xRuntime/cmake/ReleaseMode.cmakevia aCMAKE_CURRENT_SOURCE_DIR-relative path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ps2xRecomp/CMakeLists.txt | Switches the ReleaseMode.cmake include to be relative to ps2xRecomp’s directory for correct subproject builds. |
| ps2xAnalyzer/CMakeLists.txt | Switches sibling include paths and ReleaseMode.cmake include to be relative to ps2xAnalyzer’s directory for correct subproject builds. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ps2xRecomp and ps2xAnalyzer reached ps2xRuntime through CMAKE_SOURCE_DIR, which is the top-level source directory of whatever build is running. That holds only when this repository is itself the top level; adding it to another project with add_subdirectory() made both components look for ps2xRuntime/cmake/ReleaseMode.cmake under the consuming project and fail at configure time. Use CMAKE_CURRENT_SOURCE_DIR-relative paths, as ps2xRecomp already does for its ps2xRuntime include directory and ps2xRuntime does for its own cmake include. Note that each component declares its own project(), so PROJECT_SOURCE_DIR is not an alternative here.
Sinan-Karakaya
force-pushed
the
fix/cmake-sibling-paths
branch
from
August 17, 2026 16:47
e85094d to
fa7e45a
Compare
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.
ps2xRecomp and ps2xAnalyzer reach ps2xRuntime through
CMAKE_SOURCE_DIR, which is the top-level source directory of whatever build is running. That holds only when this repository is itself the top level.Adding the project to another one with
add_subdirectory()makes both components look forps2xRuntime/cmake/ReleaseMode.cmakeunder the consuming project, and configure fails:This switches them to
CMAKE_CURRENT_SOURCE_DIR-relative paths, matching what ps2xRecomp already does for its ps2xRuntime include directory (line 101) and what ps2xRuntime does for its own cmake include.Note that
PROJECT_SOURCE_DIRis not an alternative here: each component callsproject()itself, so it resolves to the component directory rather than the repository root.Verified by embedding the project as a submodule and configuring with
-DPS2X_BUILD_RUNTIME=OFF -DPS2X_BUILD_STUDIO=OFF -DPS2X_BUILD_TEST=OFF, which previously failed at configure time and now succeeds. Standalone builds are unaffected.