mods: clear the staged catalog before restaging it

copy_directory merges, so a mod package deleted from source survived in the
build output indefinitely -- it kept showing on the Mods page and inflated
the release packagers' catalog assertions (Tomba 2 found 7 manifests where 5
exist). Remove the staged tree first; this runs before the game's own
POST_BUILD copy, so game and framework catalogs both land on a clean slate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Matthew Stanley
2026-08-05 10:48:09 -07:00
parent 25d2798037
commit 084d2d4639
+7
View File
@@ -801,6 +801,13 @@ function(psxrecomp_add_runtime_target target)
# to; copy_directory merges rather than replacing the tree.
if(EXISTS "${PSXRECOMP_ROOT}/mods/builtin/packages")
add_custom_command(TARGET ${target} POST_BUILD
# Clear first: copy_directory MERGES, so a mod deleted from source
# would otherwise survive in the build output forever and keep
# appearing on the Mods page (and inflate the release packagers'
# catalog assertions). This runs before the game's own staging, so
# both catalogs land on a clean slate.
COMMAND ${CMAKE_COMMAND} -E rm -rf
"$<TARGET_FILE_DIR:${target}>/mods"
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${PSXRECOMP_ROOT}/mods/builtin"
"$<TARGET_FILE_DIR:${target}>/mods"