diff options
| author | David Racine <bass_dr@hotmail.com> | 2026-09-27 22:21:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-28 02:21:33 +0000 |
| commit | 04d0ebd38c099430d3436ad68a3b86cc61908aab (patch) | |
| tree | 9c2f72b3b25de920780240192e90df716807fc28 | |
| parent | b939163c3d45e4048ca98186aa244cf8ecd3bdac (diff) | |
Build soh.o2r as part of ALL, only when its inputs change (#7262)
`install` builds ALL, which never included GenerateSohOtr, so it copied
whatever soh.o2r was already in the build tree. The version check can't
catch that: a stale soh.o2r carries the same version as the binary.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
| -rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7792172b2..77b9e4676 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -334,9 +334,12 @@ add_custom_target( COMMAND ${CMAKE_COMMAND} -E false ) -# Target to generate only soh.o2r -add_custom_target( - GenerateSohOtr +# soh.o2r is rebuilt only when its inputs change, and is part of ALL so `install` never ships a stale one. +file(GLOB_RECURSE SOH_O2R_ASSETS CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/*) +list(FILTER SOH_O2R_ASSETS EXCLUDE REGEX "/soh/assets/custom/shaders/") +file(GLOB_RECURSE SOH_O2R_SHADERS CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/fast/shaders/*) +add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/soh/soh.o2r # copy LUS default shaders into assets/custom COMMAND ${CMAKE_COMMAND} -E rm -r -f ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/fast/shaders/ ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/ @@ -347,9 +350,11 @@ add_custom_target( ${CMAKE_PROJECT_VERSION} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/soh/soh.o2r ${CMAKE_CURRENT_SOURCE_DIR}/soh.o2r COMMENT "Generating soh.o2r..." - DEPENDS soh-o2r-packer - BYPRODUCTS ${CMAKE_SOURCE_DIR}/soh.o2r ${CMAKE_BINARY_DIR}/soh/soh.o2r + DEPENDS soh-o2r-packer ${SOH_O2R_ASSETS} ${SOH_O2R_SHADERS} + BYPRODUCTS ${CMAKE_SOURCE_DIR}/soh.o2r + VERBATIM ) +add_custom_target(GenerateSohOtr ALL DEPENDS ${CMAKE_BINARY_DIR}/soh/soh.o2r) # ExtractAssets produced soh.o2r as well as the rom archives, so keep doing that. add_dependencies(ExtractAssets GenerateSohOtr) |
