From 9f2c4c6b5943aa643234a447f1a4744a89c01083 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 18 Apr 2022 20:15:31 +1000 Subject: [PATCH] 3rdparty: Add rcheevos --- .gitmodules | 3 + 3rdparty/rcheevos/CMakeLists.txt | 47 +++++++ 3rdparty/rcheevos/rcheevos | 1 + 3rdparty/rcheevos/rcheevos.vcxproj | 84 ++++++++++++ 3rdparty/rcheevos/rcheevos.vcxproj.filters | 144 +++++++++++++++++++++ PCSX2_qt.sln | 15 +++ cmake/BuildParameters.cmake | 1 + cmake/SearchForStuff.cmake | 5 + 8 files changed, 300 insertions(+) create mode 100644 3rdparty/rcheevos/CMakeLists.txt create mode 160000 3rdparty/rcheevos/rcheevos create mode 100644 3rdparty/rcheevos/rcheevos.vcxproj create mode 100644 3rdparty/rcheevos/rcheevos.vcxproj.filters diff --git a/.gitmodules b/.gitmodules index 5581b407f2..e47df41365 100644 --- a/.gitmodules +++ b/.gitmodules @@ -36,3 +36,6 @@ [submodule "3rdparty/zstd/zstd"] path = 3rdparty/zstd/zstd url = https://github.com/facebook/zstd.git +[submodule "3rdparty/rcheevos/rcheevos"] + path = 3rdparty/rcheevos/rcheevos + url = https://github.com/RetroAchievements/rcheevos.git diff --git a/3rdparty/rcheevos/CMakeLists.txt b/3rdparty/rcheevos/CMakeLists.txt new file mode 100644 index 0000000000..34f647a1cb --- /dev/null +++ b/3rdparty/rcheevos/CMakeLists.txt @@ -0,0 +1,47 @@ +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}/rcheevos/include") +target_compile_definitions(rcheevos PRIVATE "RC_DISABLE_LUA=1" "RCHEEVOS_URL_SSL") + diff --git a/3rdparty/rcheevos/rcheevos b/3rdparty/rcheevos/rcheevos new file mode 160000 index 0000000000..31f8788fe0 --- /dev/null +++ b/3rdparty/rcheevos/rcheevos @@ -0,0 +1 @@ +Subproject commit 31f8788fe0e694e99db7ce138d45a655c556fa96 diff --git a/3rdparty/rcheevos/rcheevos.vcxproj b/3rdparty/rcheevos/rcheevos.vcxproj new file mode 100644 index 0000000000..b8ff5285bd --- /dev/null +++ b/3rdparty/rcheevos/rcheevos.vcxproj @@ -0,0 +1,84 @@ + + + + + + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3} + + + + StaticLibrary + $(DefaultPlatformToolset) + MultiByte + true + true + false + + + + + + + + + + + + + + AllRules.ruleset + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + _CRT_NONSTDC_NO_WARNINGS;RC_DISABLE_LUA;RCHEEVOS_URL_SSL;%(PreprocessorDefinitions) + $(ProjectDir)rcheevos\include;%(AdditionalIncludeDirectories) + TurnOffAllWarnings + + + + + \ No newline at end of file diff --git a/3rdparty/rcheevos/rcheevos.vcxproj.filters b/3rdparty/rcheevos/rcheevos.vcxproj.filters new file mode 100644 index 0000000000..255fc643c5 --- /dev/null +++ b/3rdparty/rcheevos/rcheevos.vcxproj.filters @@ -0,0 +1,144 @@ + + + + + {0d8ef204-a486-4873-a41d-743ca6cbe840} + + + {3aa9379e-4fd1-4772-b18c-b899631a4161} + + + {c95da822-5bca-4274-b57e-d2092e76e8f1} + + + {01fc10b0-c122-461b-b75a-f97c8b89d627} + + + {f132daaf-af7e-4a43-8fcf-5651b805b43f} + + + + + rapi + + + rapi + + + rapi + + + rapi + + + rapi + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rcheevos + + + rhash + + + rhash + + + rurl + + + + + rapi + + + rcheevos + + + rcheevos + + + rcheevos + + + rhash + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + \ No newline at end of file diff --git a/PCSX2_qt.sln b/PCSX2_qt.sln index e6625ab273..a93d6d254c 100644 --- a/PCSX2_qt.sln +++ b/PCSX2_qt.sln @@ -57,6 +57,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "updater", "updater\updater. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpuinfo", "3rdparty\cpuinfo\cpuinfo.vcxproj", "{7E183337-A7E9-460C-9D3D-568BC9F9BCC1}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rcheevos", "3rdparty\rcheevos\rcheevos.vcxproj", "{6D5B5AD9-1525-459B-939F-A5E1082AF6B3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug AVX2|x64 = Debug AVX2|x64 @@ -379,6 +381,18 @@ Global {7E183337-A7E9-460C-9D3D-568BC9F9BCC1}.Release AVX2|x64.Build.0 = Release|x64 {7E183337-A7E9-460C-9D3D-568BC9F9BCC1}.Release|x64.ActiveCfg = Release|x64 {7E183337-A7E9-460C-9D3D-568BC9F9BCC1}.Release|x64.Build.0 = Release|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Debug AVX2|x64.ActiveCfg = Debug|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Debug AVX2|x64.Build.0 = Debug|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Debug|x64.ActiveCfg = Debug|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Debug|x64.Build.0 = Debug|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Devel AVX2|x64.ActiveCfg = Devel|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Devel AVX2|x64.Build.0 = Devel|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Devel|x64.ActiveCfg = Devel|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Devel|x64.Build.0 = Devel|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Release AVX2|x64.ActiveCfg = Release|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Release AVX2|x64.Build.0 = Release|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Release|x64.ActiveCfg = Release|x64 + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -406,6 +420,7 @@ Global {D45CEC7A-3171-40DD-975D-E1544CF16139} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {A4323327-3F2B-4271-83D9-7F9A3C66B6B2} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {7E183337-A7E9-460C-9D3D-568BC9F9BCC1} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} + {6D5B5AD9-1525-459B-939F-A5E1082AF6B3} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0BC474EA-3628-45D3-9DBC-E22D0B7E0F77} diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 87e68f8415..7fb4cb2ca2 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -38,6 +38,7 @@ if(DISABLE_BUILD_DATE OR openSUSE) endif() option(USE_VTUNE "Plug VTUNE to profile GS JIT.") +option(USE_ACHIEVEMENTS "Build with RetroAchievements support" ON) #------------------------------------------------------------------------------- # Graphical option diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index b061982e62..18c6fd0527 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -234,6 +234,11 @@ if(QT_BUILD) # We use the bundled (latest) SDL version for Qt. find_optional_system_library(SDL2 3rdparty/sdl2 2.0.22) + + # rcheevos backend for RetroAchievements. + if(USE_ACHIEVEMENTS) + add_subdirectory(3rdparty/rcheevos EXCLUDE_FROM_ALL) + endif() endif() if(NOT WIN32 AND QT_BUILD)