From a62f8eac1a4b6907d5e4a6ace9cf2b616aba67a1 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 15 Aug 2024 19:18:16 +0200 Subject: [PATCH] DolphinQt: Delete output Sys folder before copying to it For a long time now, we've had a problem where game INIs persist in the copied Sys folder if they've been deleted from the original Sys folder. (I still have hundreds of game INIs locally that only set EmulationStateId, and we removed those game INIs 6 years ago. On the buildbot, we do occasionally clear out the build directories manually, so I'd assume it's not quite as bad there.) This commit fixes the problem by deleting the output Sys folder before copying the original Sys folder to the output Sys folder. This should be a bit slower, but in my testing, the difference seems small. At least if you have an SSD, which I really hope people have nowadays! Operating systems other than Windows have not been touched, because: * Android: Already explicitly deletes the output Sys folder. * macOS: Does some magic to put the Sys folder in the app bundle, which I will simply assume isn't affected by this problem, without testing. * Linux: Expects the person building to manually manage the Sys folder. --- Source/Core/DolphinQt/CMakeLists.txt | 1 + Source/Core/DolphinQt/DolphinQt.vcxproj | 1 + 2 files changed, 2 insertions(+) diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index 44a59d5313..79e5cce207 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -462,6 +462,7 @@ if(WIN32) # Copy Sys dir add_custom_command(TARGET dolphin-emu POST_BUILD + COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Sys" COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/Data/Sys" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Sys" ) diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj b/Source/Core/DolphinQt/DolphinQt.vcxproj index b023262a23..7ee8cac6a5 100644 --- a/Source/Core/DolphinQt/DolphinQt.vcxproj +++ b/Source/Core/DolphinQt/DolphinQt.vcxproj @@ -490,6 +490,7 @@ +