SDL: 3DS: Only bundle resources with tests that need them (d7bb5)

From d7bb56f16364105ec195effc88a92349f94af81d Mon Sep 17 00:00:00 2001
From: Cameron Cawley <[EMAIL REDACTED]>
Date: Sat, 12 Oct 2024 19:01:24 +0100
Subject: [PATCH] 3DS: Only bundle resources with tests that need them

---
 test/CMakeLists.txt | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 8d413c85d571b..d11a6d2b2cec3 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -399,12 +399,11 @@ if(PSP)
 endif()
 
 if(N3DS)
-    set(ROMFS_DIR "${CMAKE_CURRENT_BINARY_DIR}/romfs")
-    file(COPY ${RESOURCE_FILES} DESTINATION "${ROMFS_DIR}")
-
     foreach(APP IN LISTS SDL_TEST_EXECUTABLES)
         get_target_property(TARGET_BINARY_DIR ${APP} BINARY_DIR)
+        set(ROMFS_DIR "${TARGET_BINARY_DIR}/sdl-${APP}")
         set(SMDH_FILE "${TARGET_BINARY_DIR}/${APP}.smdh")
+        file(MAKE_DIRECTORY ${ROMFS_DIR})
         ctr_generate_smdh("${SMDH_FILE}"
             NAME "SDL-${APP}"
             DESCRIPTION "SDL2 Test suite"
@@ -461,7 +460,7 @@ add_custom_target(copy-sdl-test-resources
 )
 
 foreach(APP IN LISTS SDL_TESTS_NEEDS_RESOURCES)
-    if(PSP OR PS2)
+    if(PSP OR PS2 OR N3DS)
         foreach(RESOURCE_FILE ${RESOURCE_FILES})
             add_custom_command(TARGET ${APP} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILE} $<TARGET_FILE_DIR:${APP}>/sdl-${APP})
         endforeach()