diff --git a/.gitmodules b/.gitmodules index e8564d50..c467250f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ [submodule "lib/recomp-net"] path = lib/recomp-net url = https://github.com/TechnicallyComputers/recomp-net.git -[submodule "lib/recomp-ui"] - path = lib/recomp-ui - url = https://github.com/mstan/recomp-ui.git - branch = master diff --git a/lib/recomp-ui b/lib/recomp-ui deleted file mode 160000 index 7511bc97..00000000 --- a/lib/recomp-ui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7511bc97b49c5fd89a1dab96583eff5978018ff0 diff --git a/runtime/runtime.cmake b/runtime/runtime.cmake index 6a6e5f80..2d73ae1e 100644 --- a/runtime/runtime.cmake +++ b/runtime/runtime.cmake @@ -95,8 +95,18 @@ else() option(PSX_STATIC_RUNTIME "Statically link SDL2 + libgcc/libstdc++ for a self-contained exe" OFF) endif() -# PSX_RECOMP_UI: build the shared Dear ImGui launcher from lib/recomp-ui. +# PSX_RECOMP_UI: wire the shared Dear ImGui launcher from the *game* repo's +# root recomp-ui submodule (CMAKE_SOURCE_DIR/recomp-ui). Not vendored in +# psxrecomp — games that need the launcher own the pin. option(PSX_RECOMP_UI "Build the shared recomp-ui Dear ImGui launcher" ON) +set(RECOMP_UI_ROOT "" CACHE PATH + "Path to recomp-ui; empty = /recomp-ui") +if(PSX_RECOMP_UI AND (NOT RECOMP_UI_ROOT OR RECOMP_UI_ROOT STREQUAL "")) + if(EXISTS "${CMAKE_SOURCE_DIR}/recomp-ui/recomp_ui.cmake") + set(RECOMP_UI_ROOT "${CMAKE_SOURCE_DIR}/recomp-ui" CACHE PATH + "Path to recomp-ui; empty = /recomp-ui" FORCE) + endif() +endif() set(PSXRECOMP_RUNTIME_SOURCES ${PSXRECOMP_ROOT}/runtime/src/main.cpp @@ -551,15 +561,18 @@ function(psxrecomp_add_runtime_target target) endif() # Shared recomp-ui Dear ImGui launcher (not in the oracle build — that's headless). + # Lives at the game repo root (RECOMP_UI_ROOT / CMAKE_SOURCE_DIR/recomp-ui), + # not under psxrecomp/lib/. if(PSX_RECOMP_UI AND NOT PSXRT_ORACLE) - if(NOT EXISTS "${PSXRECOMP_ROOT}/lib/recomp-ui/recomp_ui.cmake") + if(NOT RECOMP_UI_ROOT OR NOT EXISTS "${RECOMP_UI_ROOT}/recomp_ui.cmake") message(FATAL_ERROR - "PSX_RECOMP_UI=ON but lib/recomp-ui is missing. " - "Run: git submodule update --init --recursive") + "PSX_RECOMP_UI=ON but recomp-ui is missing.\n" + "Add at the game repo root:\n" + " git submodule add -b master " + "https://github.com/mstan/recomp-ui.git recomp-ui\n" + "Or set -DRECOMP_UI_ROOT=/path/to/recomp-ui") endif() - set(RECOMP_UI_ROOT "${PSXRECOMP_ROOT}/lib/recomp-ui" CACHE PATH - "Root directory of recomp-ui" FORCE) - include("${PSXRECOMP_ROOT}/lib/recomp-ui/recomp_ui.cmake") + include("${RECOMP_UI_ROOT}/recomp_ui.cmake") set(_psx_recomp_ui_args) if(PSXRT_LAUNCHER_BOXART)