Preserve explicit recomp UI root

This commit is contained in:
Alexandros Mandravillis
2026-08-31 00:14:33 +03:00
parent 6003e63fbc
commit fe6a06d298
3 changed files with 26 additions and 2 deletions
+1
View File
@@ -610,6 +610,7 @@ if(BUILD_TESTING)
release_zip
overlay_decodable_fallback
overlay_init_guard
recomp_ui_root_override
pal_cadence_host_refresh
sdl3_main_single_include
spu_sample_scheduler_default
+3 -2
View File
@@ -1878,8 +1878,9 @@ function(psxrecomp_add_game_runtime target)
"-DPSX_GAME_VERSION=${_psxg_release_version} or delete the build cache.")
endif()
# Prefer game-root recomp-ui (runtime.cmake also auto-discovers this).
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/recomp-ui/recomp_ui.cmake")
# Use a game-root recomp-ui only when the caller did not select one.
if((NOT RECOMP_UI_ROOT OR RECOMP_UI_ROOT STREQUAL "")
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/recomp-ui/recomp_ui.cmake")
set(RECOMP_UI_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/recomp-ui" CACHE PATH
"Path to recomp-ui launcher" FORCE)
endif()
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""Guard the caller-selected recomp-ui root against game-root replacement."""
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
RUNTIME_CMAKE = ROOT / "runtime" / "runtime.cmake"
def main() -> None:
text = RUNTIME_CMAKE.read_text(encoding="utf-8")
expected = """if((NOT RECOMP_UI_ROOT OR RECOMP_UI_ROOT STREQUAL \"\")
AND EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/recomp-ui/recomp_ui.cmake\")"""
assert expected in text, (
"runtime packaging must preserve an explicit RECOMP_UI_ROOT before "
"falling back to the game-root recomp-ui"
)
if __name__ == "__main__":
main()