Skip to content

Commit

Permalink
CMake: Drop Discord Presence option
Browse files Browse the repository at this point in the history
Also no reason to disable this, and an untested configuration.
  • Loading branch information
stenzek committed Sep 16, 2023
1 parent 069d2b2 commit cf5dd8b
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 48 deletions.
1 change: 0 additions & 1 deletion cmake/BuildParameters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ option(DISABLE_BUILD_DATE "Disable including the binary compile date")
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(USE_VTUNE "Plug VTUNE to profile GS JIT.")
option(USE_DISCORD_PRESENCE "Enable support for Discord Rich Presence" ON)

#-------------------------------------------------------------------------------
# Graphical option
Expand Down
8 changes: 2 additions & 6 deletions cmake/SearchForStuff.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ add_subdirectory(3rdparty/zydis EXCLUDE_FROM_ALL)
add_subdirectory(3rdparty/zstd EXCLUDE_FROM_ALL)
add_subdirectory(3rdparty/libzip 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)
add_subdirectory(3rdparty/glad EXCLUDE_FROM_ALL)
Expand Down Expand Up @@ -167,12 +169,6 @@ if (APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET AND "${CMAKE_OSX_DEPLOYMENT_TARGET}" V
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
add_subdirectory(3rdparty/demangler EXCLUDE_FROM_ALL)

Expand Down
7 changes: 1 addition & 6 deletions pcsx2-qt/Settings/InterfaceSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.saveStateOnShutdown, "EmuCore", "SaveStateOnShutdown", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pauseOnFocusLoss, "UI", "PauseOnFocusLoss", false);
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.doubleClickTogglesFullscreen, "UI", "DoubleClickTogglesFullscreen",
Expand Down Expand Up @@ -129,12 +130,6 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget
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())
{
// language/theme doesn't make sense to have in per-game settings
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/pcsx2-qt.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(ProjectDir)\Settings;$(ProjectDir)\GameList;$(ProjectDir)\Tools\InputRecording;$(ProjectDir)\Debugger;$(ProjectDir)\Debugger\Models</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
<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>
<!-- 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>
Expand Down
5 changes: 1 addition & 4 deletions pcsx2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -863,10 +863,6 @@ if(WIN32)
target_compile_definitions(PCSX2_FLAGS INTERFACE ENABLE_RAINTEGRATION)
target_link_libraries(PCSX2_FLAGS INTERFACE rainterface)
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)
list(APPEND pcsx2InputSources
Input/DInputSource.cpp
Expand Down Expand Up @@ -1134,6 +1130,7 @@ target_link_libraries(PCSX2_FLAGS INTERFACE
zydis
cubeb
rcheevos
discord-rpc
SDL2::SDL2
ZLIB::ZLIB
SoundTouch::SoundTouch
Expand Down
2 changes: 0 additions & 2 deletions pcsx2/ImGui/FullscreenUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2765,10 +2765,8 @@ void FullscreenUI::DrawInterfaceSettingsPage()
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",
"InhibitScreensaver", true);
#ifdef 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);
#endif
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_PAUSE, "Pause On Start"), FSUI_CSTR("Pauses the emulator when a game is started."), "UI",
"StartPaused", false);
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_VIDEO, "Pause On Focus Loss"),
Expand Down
28 changes: 1 addition & 27 deletions pcsx2/VMManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#include "common/emitter/tools.h"

#include "IconsFontAwesome5.h"
#include "discord_rpc.h"
#include "fmt/core.h"

#include <atomic>
Expand All @@ -85,10 +86,6 @@
#include "common/Darwin/DarwinMisc.h"
#endif

#ifdef ENABLE_DISCORD_PRESENCE
#include "discord_rpc.h"
#endif

namespace VMManager
{
static void ApplyGameFixes();
Expand Down Expand Up @@ -192,9 +189,7 @@ static bool s_screensaver_inhibited = false;

static PINEServer s_pine_server;

#ifdef ENABLE_DISCORD_PRESENCE
static bool s_discord_presence_active = false;
#endif

bool VMManager::PerformEarlyHardwareChecks(const char** error)
{
Expand Down Expand Up @@ -2966,8 +2961,6 @@ void VMManager::ReloadPINE()
}
}

#ifdef ENABLE_DISCORD_PRESENCE

void VMManager::InitializeDiscordPresence()
{
if (s_discord_presence_active)
Expand Down Expand Up @@ -3028,22 +3021,3 @@ void VMManager::PollDiscordPresence()
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
2 changes: 1 addition & 1 deletion pcsx2/pcsx2.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>PrecompiledHeader.h</PrecompiledHeaderFile>
<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>
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
</ClCompile>
Expand Down

0 comments on commit cf5dd8b

Please sign in to comment.