From 30c58eba96925c04db69892dabc912ea3f7fb8ab Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 15 Aug 2024 19:05:29 +0200 Subject: [PATCH 1/3] MSBuild: Use SkipUnchangedFiles with Copy Just a bit of simplification. --- Source/Core/DolphinQt/DolphinQt.vcxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj b/Source/Core/DolphinQt/DolphinQt.vcxproj index 9dd72e3622..b023262a23 100644 --- a/Source/Core/DolphinQt/DolphinQt.vcxproj +++ b/Source/Core/DolphinQt/DolphinQt.vcxproj @@ -490,8 +490,8 @@ - - + + From a62f8eac1a4b6907d5e4a6ace9cf2b616aba67a1 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 15 Aug 2024 19:18:16 +0200 Subject: [PATCH 2/3] 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 @@ + From f695a65aada93948639938fe3036168394b18c4f Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 15 Aug 2024 20:28:23 +0200 Subject: [PATCH 3/3] UnitTests: Delete output Sys folder before copying to it Like the previous commit, but for UnitTests. This time all operating systems were affected. I also made UnitTests.vcxproj use the same way of copying as DolphinQt.vcxproj, just for consistency. --- Source/UnitTests/CMakeLists.txt | 1 + Source/UnitTests/UnitTests.vcxproj | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/UnitTests/CMakeLists.txt b/Source/UnitTests/CMakeLists.txt index 96f26a8793..659d9e5b28 100644 --- a/Source/UnitTests/CMakeLists.txt +++ b/Source/UnitTests/CMakeLists.txt @@ -9,6 +9,7 @@ set_target_properties(tests PROPERTIES FOLDER Tests) target_link_libraries(tests PRIVATE fmt::fmt gtest::gtest core uicommon) add_test(NAME tests COMMAND tests) add_custom_command(TARGET tests 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" ) add_dependencies(unittests tests) diff --git a/Source/UnitTests/UnitTests.vcxproj b/Source/UnitTests/UnitTests.vcxproj index 229e5b576f..48b85bfdf3 100644 --- a/Source/UnitTests/UnitTests.vcxproj +++ b/Source/UnitTests/UnitTests.vcxproj @@ -24,9 +24,6 @@ Console - - xcopy /i /e /s /y /f "$(ProjectDir)\..\..\Data\Sys\" "$(TargetDir)Sys" - @@ -109,7 +106,15 @@ - + + + + + + + + +