From 66936f20870490bedf99614877b609c944b5ba69 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Fri, 17 Mar 2023 01:19:56 -0500 Subject: [PATCH 01/17] CMake: Use generator expressions to get codesigning targets Also works around a bug where CMake's ninja generator doesn't properly handle ||'s on POST_BUILD commands, making the || apply to the whole build like ` && custom0 || custom1` --- Source/Core/DolphinQt/CMakeLists.txt | 14 ++------------ Source/Core/MacUpdater/CMakeLists.txt | 10 +--------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index e9d24bc4d1..4002d5f913 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -616,18 +616,8 @@ if(APPLE) if(MACOS_CODE_SIGNING) # Code sign make file builds - add_custom_command(TARGET dolphin-emu - POST_BUILD COMMAND - /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY}" --deep --options=runtime --entitlements "${CMAKE_SOURCE_DIR}/Source/Core/DolphinQt/DolphinEmu$<$:Debug>.entitlements" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Dolphin.app" || true) - - # Code sign builds for build systems that do have release/debug variants (Xcode) - add_custom_command(TARGET dolphin-emu - POST_BUILD COMMAND - /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY}" --deep --options=runtime --entitlements "${CMAKE_SOURCE_DIR}/Source/Core/DolphinQt/DolphinEmuDebug.entitlements" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}/Dolphin.app" || true) - - add_custom_command(TARGET dolphin-emu - POST_BUILD COMMAND - /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY}" --deep --options=runtime --entitlements "${CMAKE_SOURCE_DIR}/Source/Core/DolphinQt/DolphinEmu.entitlements" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}/Dolphin.app" || true) + add_custom_command(TARGET dolphin-emu POST_BUILD + COMMAND /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY}" --deep --options=runtime --entitlements "${CMAKE_SOURCE_DIR}/Source/Core/DolphinQt/DolphinEmu$<$:Debug>.entitlements" "$") endif() else() install(TARGETS dolphin-emu RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Source/Core/MacUpdater/CMakeLists.txt b/Source/Core/MacUpdater/CMakeLists.txt index dc09866822..e0023f3870 100644 --- a/Source/Core/MacUpdater/CMakeLists.txt +++ b/Source/Core/MacUpdater/CMakeLists.txt @@ -65,14 +65,6 @@ if(MACOS_CODE_SIGNING) set(MACOS_CODE_SIGNING_IDENTITY_UPDATER "${MACOS_CODE_SIGNING_IDENTITY}") endif() - # Make file build code sign add_custom_command(TARGET MacUpdater POST_BUILD - COMMAND test ${MacUpdater_BUNDLE_PATH} || /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY_UPDATER}" --deep --options runtime ${MacUpdater_BUNDLE_PATH}) - - # Xcode build code sign - add_custom_command(TARGET MacUpdater POST_BUILD - COMMAND test "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}/${MacUpdater_NAME}.app" || /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY_UPDATER}" --deep --options runtime "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}/${MacUpdater_NAME}.app") - - add_custom_command(TARGET MacUpdater POST_BUILD - COMMAND test "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}/${MacUpdater_NAME}.app" || /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY_UPDATER}" --deep --options runtime "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}/${MacUpdater_NAME}.app") + COMMAND /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY_UPDATER}" --deep --options runtime $) endif() From d037c60caff4c4773738fd8dd3d1159cc8ed101b Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Fri, 17 Mar 2023 01:20:27 -0500 Subject: [PATCH 02/17] CMake: Use proper dependency tracking command for storyboard compiling --- Source/Core/MacUpdater/CMakeLists.txt | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Source/Core/MacUpdater/CMakeLists.txt b/Source/Core/MacUpdater/CMakeLists.txt index e0023f3870..d610a02bfa 100644 --- a/Source/Core/MacUpdater/CMakeLists.txt +++ b/Source/Core/MacUpdater/CMakeLists.txt @@ -47,17 +47,14 @@ if (${IBTOOL} STREQUAL "IBTOOL-NOTFOUND") endif() foreach(sb ${STORYBOARDS}) - set(MacUpdater_BIN_DIR ${CMAKE_BINARY_DIR}/Binaries) - - if (CMAKE_GENERATOR STREQUAL Xcode) - string(APPEND MacUpdater_BIN_DIR "/\${CONFIGURATION}") - endif() - - add_custom_command(TARGET MacUpdater POST_BUILD - COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text - --compile ${MacUpdater_BUNDLE_PATH}/Contents/Resources/${sb}c - ${CMAKE_CURRENT_SOURCE_DIR}/${sb} - COMMENT "Compiling Storyboard ${sb}...") + set(output ${CMAKE_CURRENT_BINARY_DIR}/${sb}c) + set(input ${CMAKE_CURRENT_SOURCE_DIR}/${sb}) + add_custom_command(OUTPUT ${output} + COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text --compile ${output} ${input} + DEPENDS ${input} + COMMENT "Compiling Storyboard ${sb}...") + target_sources(MacUpdater PRIVATE ${output}) + set_source_files_properties(${output} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) endforeach() if(MACOS_CODE_SIGNING) From 9186050daaa3cd85eabee5c5fe677f39b2a5cbe5 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Sat, 7 Jan 2023 23:52:36 +0100 Subject: [PATCH 03/17] VideoBackends:Vulkan: Clean up submission thread BlockingLoop usage --- .../Vulkan/CommandBufferManager.cpp | 47 +++++++------------ .../Vulkan/CommandBufferManager.h | 2 - 2 files changed, 18 insertions(+), 31 deletions(-) diff --git a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp index 80bbd7e5b5..9c460905f7 100644 --- a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp +++ b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp @@ -226,33 +226,25 @@ bool CommandBufferManager::CreateSubmitThread() Common::SetCurrentThreadName("Vulkan CommandBufferManager SubmitThread"); m_submit_loop->Run([this]() { - PendingCommandBufferSubmit submit; + while (true) { - std::lock_guard guard(m_pending_submit_lock); - if (m_pending_submits.empty()) + PendingCommandBufferSubmit submit; { - m_submit_loop->AllowSleep(); - m_submit_worker_idle = true; - m_submit_worker_condvar.notify_all(); - return; + std::lock_guard guard(m_pending_submit_lock); + if (m_pending_submits.empty()) + { + m_submit_loop->AllowSleep(); + return; + } + + submit = m_pending_submits.front(); + m_pending_submits.pop_front(); } - submit = m_pending_submits.front(); - m_pending_submits.pop_front(); - } - - SubmitCommandBuffer(submit.command_buffer_index, submit.present_swap_chain, - submit.present_image_index); - CmdBufferResources& resources = m_command_buffers[submit.command_buffer_index]; - resources.waiting_for_submit.store(false, std::memory_order_release); - - { - std::lock_guard guard(m_pending_submit_lock); - if (m_pending_submits.empty()) - { - m_submit_worker_idle = true; - m_submit_worker_condvar.notify_all(); - } + SubmitCommandBuffer(submit.command_buffer_index, submit.present_swap_chain, + submit.present_image_index); + CmdBufferResources& resources = m_command_buffers[submit.command_buffer_index]; + resources.waiting_for_submit.store(false, std::memory_order_release); } }); }); @@ -265,8 +257,7 @@ void CommandBufferManager::WaitForWorkerThreadIdle() if (!m_use_threaded_submission) return; - std::unique_lock lock{m_pending_submit_lock}; - m_submit_worker_condvar.wait(lock, [&] { return m_submit_worker_idle; }); + m_submit_loop->Wait(); } void CommandBufferManager::WaitForFenceCounter(u64 fence_counter) @@ -354,12 +345,10 @@ void CommandBufferManager::SubmitCommandBuffer(bool submit_on_worker_thread, // Push to the pending submit queue. { std::lock_guard guard(m_pending_submit_lock); - m_submit_worker_idle = false; m_pending_submits.push_back({present_swap_chain, present_image_index, m_current_cmd_buffer}); + // Wake up the worker thread for a single iteration. + m_submit_loop->Wakeup(); } - - // Wake up the worker thread for a single iteration. - m_submit_loop->Wakeup(); } else { diff --git a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h index 7b4772760a..398f56e4ce 100644 --- a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h +++ b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h @@ -157,8 +157,6 @@ private: VkSemaphore m_present_semaphore = VK_NULL_HANDLE; std::deque m_pending_submits; std::mutex m_pending_submit_lock; - std::condition_variable m_submit_worker_condvar; - bool m_submit_worker_idle = true; Common::Flag m_last_present_failed; Common::Flag m_last_present_done; VkResult m_last_present_result = VK_SUCCESS; From 9d422d14d501df6ca3876ac500056dad923f4537 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Mon, 20 Mar 2023 16:31:40 +0100 Subject: [PATCH 04/17] WorkQueueThread: Fix WaitForCompletion --- Source/Core/Common/WorkQueueThread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/WorkQueueThread.h b/Source/Core/Common/WorkQueueThread.h index be3c3198d4..be723299b2 100644 --- a/Source/Core/Common/WorkQueueThread.h +++ b/Source/Core/Common/WorkQueueThread.h @@ -124,7 +124,7 @@ public: if (m_idle && !m_cancelling.load()) return; - m_wait_cond_var.wait(lg, [&] { return m_idle && m_cancelling.load(); }); + m_wait_cond_var.wait(lg, [&] { return m_idle && !m_cancelling; }); } // If the worker polls IsCanceling(), it can abort its work when Cancelling From c1be9628fc1237ffbae14f2d1a15ed1895be2eda Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Fri, 27 Jan 2023 15:06:35 +0100 Subject: [PATCH 05/17] VideoBackends:Vulkan: Use WorkQueueThread --- .../Vulkan/CommandBufferManager.cpp | 43 ++++--------------- .../Vulkan/CommandBufferManager.h | 6 +-- 2 files changed, 10 insertions(+), 39 deletions(-) diff --git a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp index 9c460905f7..be02034f67 100644 --- a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp +++ b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp @@ -26,8 +26,7 @@ CommandBufferManager::~CommandBufferManager() if (m_use_threaded_submission) { WaitForWorkerThreadIdle(); - m_submit_loop->Stop(); - m_submit_thread.join(); + m_submit_thread.Shutdown(); } DestroyCommandBuffers(); @@ -221,32 +220,11 @@ VkDescriptorSet CommandBufferManager::AllocateDescriptorSet(VkDescriptorSetLayou bool CommandBufferManager::CreateSubmitThread() { - m_submit_loop = std::make_unique(); - m_submit_thread = std::thread([this]() { - Common::SetCurrentThreadName("Vulkan CommandBufferManager SubmitThread"); - - m_submit_loop->Run([this]() { - while (true) - { - PendingCommandBufferSubmit submit; - { - std::lock_guard guard(m_pending_submit_lock); - if (m_pending_submits.empty()) - { - m_submit_loop->AllowSleep(); - return; - } - - submit = m_pending_submits.front(); - m_pending_submits.pop_front(); - } - - SubmitCommandBuffer(submit.command_buffer_index, submit.present_swap_chain, - submit.present_image_index); - CmdBufferResources& resources = m_command_buffers[submit.command_buffer_index]; - resources.waiting_for_submit.store(false, std::memory_order_release); - } - }); + m_submit_thread.Reset("VK submission thread", [this](PendingCommandBufferSubmit submit) { + SubmitCommandBuffer(submit.command_buffer_index, submit.present_swap_chain, + submit.present_image_index); + CmdBufferResources& resources = m_command_buffers[submit.command_buffer_index]; + resources.waiting_for_submit.store(false, std::memory_order_release); }); return true; @@ -257,7 +235,7 @@ void CommandBufferManager::WaitForWorkerThreadIdle() if (!m_use_threaded_submission) return; - m_submit_loop->Wait(); + m_submit_thread.WaitForCompletion(); } void CommandBufferManager::WaitForFenceCounter(u64 fence_counter) @@ -343,12 +321,7 @@ void CommandBufferManager::SubmitCommandBuffer(bool submit_on_worker_thread, { resources.waiting_for_submit.store(true, std::memory_order_relaxed); // Push to the pending submit queue. - { - std::lock_guard guard(m_pending_submit_lock); - m_pending_submits.push_back({present_swap_chain, present_image_index, m_current_cmd_buffer}); - // Wake up the worker thread for a single iteration. - m_submit_loop->Wakeup(); - } + m_submit_thread.Push({present_swap_chain, present_image_index, m_current_cmd_buffer}); } else { diff --git a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h index 398f56e4ce..0249097423 100644 --- a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h +++ b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h @@ -14,6 +14,7 @@ #include #include +#include #include "Common/BlockingLoop.h" #include "Common/Flag.h" #include "Common/Semaphore.h" @@ -146,17 +147,14 @@ private: u32 m_current_cmd_buffer = 0; // Threaded command buffer execution - std::thread m_submit_thread; - std::unique_ptr m_submit_loop; struct PendingCommandBufferSubmit { VkSwapchainKHR present_swap_chain; u32 present_image_index; u32 command_buffer_index; }; + Common::WorkQueueThread m_submit_thread; VkSemaphore m_present_semaphore = VK_NULL_HANDLE; - std::deque m_pending_submits; - std::mutex m_pending_submit_lock; Common::Flag m_last_present_failed; Common::Flag m_last_present_done; VkResult m_last_present_result = VK_SUCCESS; From 4513238213ca87d43b755a41b093c182fcaf9812 Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Tue, 28 Feb 2023 04:18:43 -0500 Subject: [PATCH 06/17] Added rcheevos submodule Added the RetroAchievements rcheevos library as a submodule from GitHub. --- .gitmodules | 3 +++ Externals/rcheevos/rcheevos | 1 + 2 files changed, 4 insertions(+) create mode 160000 Externals/rcheevos/rcheevos diff --git a/.gitmodules b/.gitmodules index 4d4ad583f9..4ae9400cff 100644 --- a/.gitmodules +++ b/.gitmodules @@ -51,3 +51,6 @@ [submodule "Externals/gtest"] path = Externals/gtest url = https://github.com/google/googletest.git +[submodule "Externals/rcheevos/rcheevos"] + path = Externals/rcheevos/rcheevos + url = https://github.com/RetroAchievements/rcheevos.git diff --git a/Externals/rcheevos/rcheevos b/Externals/rcheevos/rcheevos new file mode 160000 index 0000000000..c5304a61bc --- /dev/null +++ b/Externals/rcheevos/rcheevos @@ -0,0 +1 @@ +Subproject commit c5304a61bcf256ae80fcd1c8f64ad9646aaea757 From 2836feac71ca45edd59619b11932747b57d5a0d0 Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Sat, 11 Mar 2023 00:24:20 -0500 Subject: [PATCH 07/17] Added rcheevos to Externals Adds the rcheevos library from RetroAchievements to the Dolphin Externals as a submodule. Change was verified to import correctly and build both via Visual Studio and via cmake ninja. --- CMakeLists.txt | 2 + Externals/rcheevos/CMakeLists.txt | 49 +++++++++++++++++ Externals/rcheevos/exports.props | 13 +++++ Externals/rcheevos/rcheevos.vcxproj | 71 +++++++++++++++++++++++++ Source/Core/Core/CMakeLists.txt | 1 + Source/Core/DolphinLib.vcxproj | 1 + Source/Core/DolphinQt/DolphinQt.vcxproj | 1 + Source/dolphin-emu.sln | 11 ++++ 8 files changed, 149 insertions(+) create mode 100644 Externals/rcheevos/CMakeLists.txt create mode 100644 Externals/rcheevos/exports.props create mode 100644 Externals/rcheevos/rcheevos.vcxproj diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fd3972ad2..9d4fe3fa8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -975,6 +975,8 @@ add_subdirectory(Externals/rangeset) add_subdirectory(Externals/FatFs) +add_subdirectory(Externals/rcheevos) + ######################################## # Pre-build events: Define configuration variables and write SCM info header # diff --git a/Externals/rcheevos/CMakeLists.txt b/Externals/rcheevos/CMakeLists.txt new file mode 100644 index 0000000000..0fea1f9873 --- /dev/null +++ b/Externals/rcheevos/CMakeLists.txt @@ -0,0 +1,49 @@ +add_library(rcheevos + rcheevos/include/rc_api_editor.h + rcheevos/include/rc_api_info.h + rcheevos/include/rc_api_request.h + rcheevos/include/rc_api_runtime.h + rcheevos/include/rc_api_user.h + rcheevos/include/rc_consoles.h + rcheevos/include/rc_error.h + rcheevos/include/rc_hash.h + rcheevos/include/rcheevos.h + rcheevos/include/rc_runtime.h + rcheevos/include/rc_runtime_types.h + rcheevos/include/rc_url.h + rcheevos/src/rapi/rc_api_common.c + rcheevos/src/rapi/rc_api_common.h + rcheevos/src/rapi/rc_api_editor.c + rcheevos/src/rapi/rc_api_info.c + rcheevos/src/rapi/rc_api_runtime.c + rcheevos/src/rapi/rc_api_user.c + rcheevos/src/rcheevos/alloc.c + rcheevos/src/rcheevos/compat.c + rcheevos/src/rcheevos/condition.c + rcheevos/src/rcheevos/condset.c + rcheevos/src/rcheevos/consoleinfo.c + rcheevos/src/rcheevos/format.c + rcheevos/src/rcheevos/lboard.c + rcheevos/src/rcheevos/memref.c + rcheevos/src/rcheevos/operand.c + rcheevos/src/rcheevos/rc_compat.h + rcheevos/src/rcheevos/rc_internal.h + rcheevos/src/rcheevos/rc_validate.c + rcheevos/src/rcheevos/rc_validate.h + rcheevos/src/rcheevos/richpresence.c + rcheevos/src/rcheevos/runtime.c + rcheevos/src/rcheevos/runtime_progress.c + rcheevos/src/rcheevos/trigger.c + rcheevos/src/rcheevos/value.c + rcheevos/src/rhash/hash.c + rcheevos/src/rhash/md5.c + rcheevos/src/rhash/md5.h + rcheevos/src/rurl/url.c +) + +target_include_directories(rcheevos PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/rcheevos/include") +target_include_directories(rcheevos INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") +target_compile_definitions(rcheevos PRIVATE "RC_DISABLE_LUA=1" "RCHEEVOS_URL_SSL") +if(CMAKE_SYSTEM_NAME MATCHES "Windows") + target_compile_definitions(rcheevos PRIVATE "_CRT_SECURE_NO_WARNINGS") +endif() diff --git a/Externals/rcheevos/exports.props b/Externals/rcheevos/exports.props new file mode 100644 index 0000000000..d5e26ded5e --- /dev/null +++ b/Externals/rcheevos/exports.props @@ -0,0 +1,13 @@ + + + + + $(ExternalsDir)rcheevos;%(AdditionalIncludeDirectories) + + + + + {CC99A910-3752-4465-95AA-7DC240D92A99} + + + diff --git a/Externals/rcheevos/rcheevos.vcxproj b/Externals/rcheevos/rcheevos.vcxproj new file mode 100644 index 0000000000..cde8fd6ecd --- /dev/null +++ b/Externals/rcheevos/rcheevos.vcxproj @@ -0,0 +1,71 @@ + + + + + + {CC99A910-3752-4465-95AA-7DC240D92A99} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RC_DISABLE_LUA;RCHEEVOS_URL_SSL;%(PreprocessorDefinitions) + $(ProjectDir)rcheevos\include;%(AdditionalIncludeDirectories) + + + + + + \ No newline at end of file diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index 682c686c7d..9d699dbab1 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -602,6 +602,7 @@ PUBLIC ${MBEDTLS_LIBRARIES} pugixml RangeSet::RangeSet + rcheevos sfml-network sfml-system videonull diff --git a/Source/Core/DolphinLib.vcxproj b/Source/Core/DolphinLib.vcxproj index 5875de1550..827652cae7 100644 --- a/Source/Core/DolphinLib.vcxproj +++ b/Source/Core/DolphinLib.vcxproj @@ -52,6 +52,7 @@ + diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj b/Source/Core/DolphinQt/DolphinQt.vcxproj index 838e33d7a1..01280a46a9 100644 --- a/Source/Core/DolphinQt/DolphinQt.vcxproj +++ b/Source/Core/DolphinQt/DolphinQt.vcxproj @@ -436,6 +436,7 @@ + diff --git a/Source/dolphin-emu.sln b/Source/dolphin-emu.sln index eae84c8a7d..916bc2ec73 100644 --- a/Source/dolphin-emu.sln +++ b/Source/dolphin-emu.sln @@ -87,6 +87,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FatFs", "..\Externals\FatFs EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spng", "..\Externals\libspng\spng.vcxproj", "{447B7B1E-1D74-4AEF-B2B9-6EB41C5D5313}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rcheevos", "..\Externals\rcheevos\rcheevos.vcxproj", "{CC99A910-3752-4465-95AA-7DC240D92A99}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM64 = Debug|ARM64 @@ -419,6 +421,14 @@ Global {447B7B1E-1D74-4AEF-B2B9-6EB41C5D5313}.Release|ARM64.Build.0 = Release|ARM64 {447B7B1E-1D74-4AEF-B2B9-6EB41C5D5313}.Release|x64.ActiveCfg = Release|x64 {447B7B1E-1D74-4AEF-B2B9-6EB41C5D5313}.Release|x64.Build.0 = Release|x64 + {CC99A910-3752-4465-95AA-7DC240D92A99}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {CC99A910-3752-4465-95AA-7DC240D92A99}.Debug|ARM64.Build.0 = Debug|ARM64 + {CC99A910-3752-4465-95AA-7DC240D92A99}.Debug|x64.ActiveCfg = Debug|x64 + {CC99A910-3752-4465-95AA-7DC240D92A99}.Debug|x64.Build.0 = Debug|x64 + {CC99A910-3752-4465-95AA-7DC240D92A99}.Release|ARM64.ActiveCfg = Release|ARM64 + {CC99A910-3752-4465-95AA-7DC240D92A99}.Release|ARM64.Build.0 = Release|ARM64 + {CC99A910-3752-4465-95AA-7DC240D92A99}.Release|x64.ActiveCfg = Release|x64 + {CC99A910-3752-4465-95AA-7DC240D92A99}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -455,6 +465,7 @@ Global {8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} {3F17D282-A77D-4931-B844-903AD0809A5E} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} {447B7B1E-1D74-4AEF-B2B9-6EB41C5D5313} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} + {CC99A910-3752-4465-95AA-7DC240D92A99} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {64B0A343-3B94-4522-9C24-6937FE5EFB22} From f3114b59f48260a27d173e028be30dc3d79a3abb Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Sat, 18 Mar 2023 12:22:17 -0400 Subject: [PATCH 08/17] Added USE_RETRO_ACHIEVEMENTS compiler flag Added a flag to VS and CMake for enabling RetroAchievements integration. --- CMakeLists.txt | 5 ++++- Source/Core/Core/CMakeLists.txt | 6 +++++- Source/Core/DolphinQt/CMakeLists.txt | 7 ++++++- Source/VSProps/Base.Dolphin.props | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d4fe3fa8a..ae86d33b42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,7 @@ option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence, show the current gam option(USE_MGBA "Enables GBA controllers emulation using libmgba" ON) option(ENABLE_AUTOUPDATE "Enables support for automatic updates" ON) option(STEAM "Creates a build for Steam" OFF) +option(USE_RETRO_ACHIEVEMENTS "Enables integration with retroachievements.org" ON) # Maintainers: if you consider blanket disabling this for your users, please # consider the following points: @@ -975,7 +976,9 @@ add_subdirectory(Externals/rangeset) add_subdirectory(Externals/FatFs) -add_subdirectory(Externals/rcheevos) +if (USE_RETRO_ACHIEVEMENTS) + add_subdirectory(Externals/rcheevos) +endif() ######################################## # Pre-build events: Define configuration variables and write SCM info header diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index 9d699dbab1..08b8ffa9c7 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -602,7 +602,6 @@ PUBLIC ${MBEDTLS_LIBRARIES} pugixml RangeSet::RangeSet - rcheevos sfml-network sfml-system videonull @@ -748,3 +747,8 @@ if(MSVC) # Add precompiled header target_link_libraries(core PRIVATE use_pch) endif() + +if(USE_RETRO_ACHIEVEMENTS) + target_link_libraries(core PRIVATE rcheevos) + target_compile_definitions(core PRIVATE -DUSE_RETRO_ACHIEVEMENTS) +endif() \ No newline at end of file diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index e9d24bc4d1..184ce1db04 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -686,4 +686,9 @@ endif() if(USE_DISCORD_PRESENCE) target_compile_definitions(dolphin-emu PRIVATE -DUSE_DISCORD_PRESENCE) -endif() \ No newline at end of file +endif() + +if(USE_RETRO_ACHIEVEMENTS) + target_link_libraries(dolphin-emu PRIVATE rcheevos) + target_compile_definitions(dolphin-emu PRIVATE -DUSE_RETRO_ACHIEVEMENTS) +endif() diff --git a/Source/VSProps/Base.Dolphin.props b/Source/VSProps/Base.Dolphin.props index 15e3b0f072..6a9d0192d2 100644 --- a/Source/VSProps/Base.Dolphin.props +++ b/Source/VSProps/Base.Dolphin.props @@ -45,6 +45,7 @@ AUTOUPDATE;%(PreprocessorDefinitions) HAVE_SDL2;%(PreprocessorDefinitions) STEAM;%(PreprocessorDefinitions) + USE_RETRO_ACHIEVEMENTS;%(PreprocessorDefinitions)