CMake: Drop Discord Presence option

Also no reason to disable this, and an untested configuration.
This commit is contained in:
Stenzek 2023-09-16 15:24:34 +10:00 committed by Connor McLaughlin
parent 069d2b275a
commit cf5dd8b822
8 changed files with 7 additions and 48 deletions

View File

@ -8,7 +8,6 @@ option(DISABLE_BUILD_DATE "Disable including the binary compile date")
option(ENABLE_TESTS "Enables building the unit tests" ON) option(ENABLE_TESTS "Enables building the unit tests" ON)
option(LTO_PCSX2_CORE "Enable LTO/IPO/LTCG on the subset of pcsx2 that benefits most from it but not anything else") option(LTO_PCSX2_CORE "Enable LTO/IPO/LTCG on the subset of pcsx2 that benefits most from it but not anything else")
option(USE_VTUNE "Plug VTUNE to profile GS JIT.") option(USE_VTUNE "Plug VTUNE to profile GS JIT.")
option(USE_DISCORD_PRESENCE "Enable support for Discord Rich Presence" ON)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Graphical option # Graphical option

View File

@ -138,6 +138,8 @@ add_subdirectory(3rdparty/zydis EXCLUDE_FROM_ALL)
add_subdirectory(3rdparty/zstd EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/zstd EXCLUDE_FROM_ALL)
add_subdirectory(3rdparty/libzip EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/libzip EXCLUDE_FROM_ALL)
add_subdirectory(3rdparty/rcheevos EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/rcheevos EXCLUDE_FROM_ALL)
add_subdirectory(3rdparty/rapidjson EXCLUDE_FROM_ALL)
add_subdirectory(3rdparty/discord-rpc EXCLUDE_FROM_ALL)
if(USE_OPENGL) if(USE_OPENGL)
add_subdirectory(3rdparty/glad EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/glad EXCLUDE_FROM_ALL)
@ -167,12 +169,6 @@ if (APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET AND "${CMAKE_OSX_DEPLOYMENT_TARGET}" V
endif() endif()
endif() endif()
# Discord-RPC library for rich presence.
if(USE_DISCORD_PRESENCE)
add_subdirectory(3rdparty/rapidjson EXCLUDE_FROM_ALL)
add_subdirectory(3rdparty/discord-rpc EXCLUDE_FROM_ALL)
endif()
# Demangler for the debugger # Demangler for the debugger
add_subdirectory(3rdparty/demangler EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/demangler EXCLUDE_FROM_ALL)

View File

@ -81,6 +81,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.saveStateOnShutdown, "EmuCore", "SaveStateOnShutdown", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.saveStateOnShutdown, "EmuCore", "SaveStateOnShutdown", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pauseOnFocusLoss, "UI", "PauseOnFocusLoss", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pauseOnFocusLoss, "UI", "PauseOnFocusLoss", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.backupSaveStates, "EmuCore", "BackupSavestate", true); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.backupSaveStates, "EmuCore", "BackupSavestate", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.discordPresence, "EmuCore", "EnableDiscordPresence", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.startFullscreen, "UI", "StartFullscreen", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.startFullscreen, "UI", "StartFullscreen", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.doubleClickTogglesFullscreen, "UI", "DoubleClickTogglesFullscreen", SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.doubleClickTogglesFullscreen, "UI", "DoubleClickTogglesFullscreen",
@ -129,12 +130,6 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget
m_ui.automaticUpdaterGroup->hide(); m_ui.automaticUpdaterGroup->hide();
} }
#ifdef ENABLE_DISCORD_PRESENCE
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.discordPresence, "EmuCore", "EnableDiscordPresence", false);
#else
m_ui.discordPresence->setEnabled(false);
#endif
if (dialog->isPerGameSettings()) if (dialog->isPerGameSettings())
{ {
// language/theme doesn't make sense to have in per-game settings // language/theme doesn't make sense to have in per-game settings

View File

@ -49,7 +49,7 @@
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(ProjectDir)\Settings;$(ProjectDir)\GameList;$(ProjectDir)\Tools\InputRecording;$(ProjectDir)\Debugger;$(ProjectDir)\Debugger\Models</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(ProjectDir)\Settings;$(ProjectDir)\GameList;$(ProjectDir)\Tools\InputRecording;$(ProjectDir)\Debugger;$(ProjectDir)\Debugger\Models</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>PrecompiledHeader.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>PrecompiledHeader.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>LZMA_API_STATIC;ENABLE_RAINTEGRATION;ENABLE_DISCORD_PRESENCE;ENABLE_OPENGL;ENABLE_VULKAN;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>LZMA_API_STATIC;ENABLE_RAINTEGRATION;ENABLE_OPENGL;ENABLE_VULKAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QT_NO_EXCEPTIONS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>QT_NO_EXCEPTIONS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- Current Qt debug builds assert on RTTI. Remove this once we next build Qt. --> <!-- Current Qt debug builds assert on RTTI. Remove this once we next build Qt. -->
<RuntimeTypeInfo Condition="$(Configuration.Contains(Clang)) And $(Configuration.Contains(Debug))">true</RuntimeTypeInfo> <RuntimeTypeInfo Condition="$(Configuration.Contains(Clang)) And $(Configuration.Contains(Debug))">true</RuntimeTypeInfo>

View File

@ -863,10 +863,6 @@ if(WIN32)
target_compile_definitions(PCSX2_FLAGS INTERFACE ENABLE_RAINTEGRATION) target_compile_definitions(PCSX2_FLAGS INTERFACE ENABLE_RAINTEGRATION)
target_link_libraries(PCSX2_FLAGS INTERFACE rainterface) target_link_libraries(PCSX2_FLAGS INTERFACE rainterface)
endif() endif()
if(USE_DISCORD_PRESENCE)
target_compile_definitions(PCSX2_FLAGS INTERFACE ENABLE_DISCORD_PRESENCE)
target_link_libraries(PCSX2_FLAGS INTERFACE discord-rpc)
endif()
if(WIN32) if(WIN32)
list(APPEND pcsx2InputSources list(APPEND pcsx2InputSources
Input/DInputSource.cpp Input/DInputSource.cpp
@ -1134,6 +1130,7 @@ target_link_libraries(PCSX2_FLAGS INTERFACE
zydis zydis
cubeb cubeb
rcheevos rcheevos
discord-rpc
SDL2::SDL2 SDL2::SDL2
ZLIB::ZLIB ZLIB::ZLIB
SoundTouch::SoundTouch SoundTouch::SoundTouch

View File

@ -2765,10 +2765,8 @@ void FullscreenUI::DrawInterfaceSettingsPage()
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_MAGIC, "Inhibit Screensaver"), DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_MAGIC, "Inhibit Screensaver"),
FSUI_CSTR("Prevents the screen saver from activating and the host from sleeping while emulation is running."), "EmuCore", FSUI_CSTR("Prevents the screen saver from activating and the host from sleeping while emulation is running."), "EmuCore",
"InhibitScreensaver", true); "InhibitScreensaver", true);
#ifdef ENABLE_DISCORD_PRESENCE
DrawToggleSetting(bsi, "Enable Discord Presence", DrawToggleSetting(bsi, "Enable Discord Presence",
FSUI_CSTR("Shows the game you are currently playing as part of your profile on Discord."), "UI", "DiscordPresence", false); FSUI_CSTR("Shows the game you are currently playing as part of your profile on Discord."), "UI", "DiscordPresence", false);
#endif
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_PAUSE, "Pause On Start"), FSUI_CSTR("Pauses the emulator when a game is started."), "UI", DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_PAUSE, "Pause On Start"), FSUI_CSTR("Pauses the emulator when a game is started."), "UI",
"StartPaused", false); "StartPaused", false);
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_VIDEO, "Pause On Focus Loss"), DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_VIDEO, "Pause On Focus Loss"),

View File

@ -65,6 +65,7 @@
#include "common/emitter/tools.h" #include "common/emitter/tools.h"
#include "IconsFontAwesome5.h" #include "IconsFontAwesome5.h"
#include "discord_rpc.h"
#include "fmt/core.h" #include "fmt/core.h"
#include <atomic> #include <atomic>
@ -85,10 +86,6 @@
#include "common/Darwin/DarwinMisc.h" #include "common/Darwin/DarwinMisc.h"
#endif #endif
#ifdef ENABLE_DISCORD_PRESENCE
#include "discord_rpc.h"
#endif
namespace VMManager namespace VMManager
{ {
static void ApplyGameFixes(); static void ApplyGameFixes();
@ -192,9 +189,7 @@ static bool s_screensaver_inhibited = false;
static PINEServer s_pine_server; static PINEServer s_pine_server;
#ifdef ENABLE_DISCORD_PRESENCE
static bool s_discord_presence_active = false; static bool s_discord_presence_active = false;
#endif
bool VMManager::PerformEarlyHardwareChecks(const char** error) bool VMManager::PerformEarlyHardwareChecks(const char** error)
{ {
@ -2966,8 +2961,6 @@ void VMManager::ReloadPINE()
} }
} }
#ifdef ENABLE_DISCORD_PRESENCE
void VMManager::InitializeDiscordPresence() void VMManager::InitializeDiscordPresence()
{ {
if (s_discord_presence_active) if (s_discord_presence_active)
@ -3028,22 +3021,3 @@ void VMManager::PollDiscordPresence()
Discord_RunCallbacks(); Discord_RunCallbacks();
} }
#else // ENABLE_DISCORD_PRESENCE
void VMManager::InitializeDiscordPresence()
{
}
void VMManager::ShutdownDiscordPresence()
{
}
void VMManager::UpdateDiscordPresence(const std::string& rich_presence)
{
}
void VMManager::PollDiscordPresence()
{
}
#endif // ENABLE_DISCORD_PRESENCE

View File

@ -64,7 +64,7 @@
<PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>PrecompiledHeader.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>PrecompiledHeader.h</PrecompiledHeaderFile>
<ForcedIncludeFiles>PrecompiledHeader.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <ForcedIncludeFiles>PrecompiledHeader.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<PreprocessorDefinitions>LZMA_API_STATIC;ST_NO_EXCEPTION_HANDLING;ENABLE_DISCORD_PRESENCE;ENABLE_RAINTEGRATION;ENABLE_OPENGL;ENABLE_VULKAN;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>LZMA_API_STATIC;ST_NO_EXCEPTION_HANDLING;ENABLE_RAINTEGRATION;ENABLE_OPENGL;ENABLE_VULKAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='x64'">XBYAK_NO_EXCEPTION;ZYCORE_STATIC_DEFINE;ZYDIS_STATIC_DEFINE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="'$(Platform)'=='x64'">XBYAK_NO_EXCEPTION;ZYCORE_STATIC_DEFINE;ZYDIS_STATIC_DEFINE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName> <ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
</ClCompile> </ClCompile>