mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
Preserve explicit recomp UI root
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
Reference in New Issue
Block a user