From 4513238213ca87d43b755a41b093c182fcaf9812 Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Tue, 28 Feb 2023 04:18:43 -0500 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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)