From c1ed5184e79bf536c407dadf4c398a5976b4c21d Mon Sep 17 00:00:00 2001 From: Anonymous275 <36374260+Anonymous-275@users.noreply.github.com> Date: Fri, 22 Jul 2022 14:43:56 +0300 Subject: [PATCH] Commented unused library, Debug build fix --- CMakeLists.txt | 18 ++++++++++++------ src/Discord.cpp | 14 +++++++++++++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fc46b0..ee33217 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ set(wxBUILD_SHARED OFF) set(wxBUILD_MSVC_MULTIPROC ON) set(wxBUILD_USE_STATIC_RUNTIME ON) -add_subdirectory(include/wxWidgets) +#add_subdirectory(include/wxWidgets) add_subdirectory(include/cpp-httplib) add_subdirectory(include/tomlplusplus) @@ -40,7 +40,8 @@ add_executable(${PROJECT_NAME} src/Memory/GELua.cpp include/Memory/GELua.h src/Memory/IPC.cpp include/Memory/IPC.h src/Logger.cpp include/Logger.h - src/gui/Gui.cpp include/Json.h + #src/gui/Gui.cpp + include/Json.h src/gui/gifs.cpp src/gui/gifs.h src/Network/Http.cpp include/Http.h src/Network/Server.cpp include/Server.h @@ -50,14 +51,19 @@ add_executable(${PROJECT_NAME} src/Discord.cpp src/Config.cpp ) - if (WIN32) - target_link_libraries(${PROJECT_NAME} PRIVATE ${VcpkgRoot}/lib/discord-rpc.lib - ZLIB::ZLIB discord-rpc OpenSSL::SSL OpenSSL::Crypto ws2_32 wx::net wx::core wx::base Dbghelp comsuppw minhook::minhook nlohmann_json nlohmann_json::nlohmann_json) + if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + target_link_libraries(${PROJECT_NAME} PRIVATE discord-rpc) + endif() + #target_link_libraries(${PROJECT_NAME} PRIVATE wx::net wx::core wx::base) + target_link_libraries(${PROJECT_NAME} PRIVATE + ZLIB::ZLIB OpenSSL::SSL OpenSSL::Crypto ws2_32 + Dbghelp comsuppw minhook::minhook nlohmann_json nlohmann_json::nlohmann_json) else(WIN32) #MINGW add_definitions("-D_WIN32_WINNT=0x0600") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -s --static") - target_link_libraries(${PROJECT_NAME} discord-rpc ssl crypto ws2_32 ssp crypt32 z Dbghelp comsuppw minhook::minhook nlohmann_json nlohmann_json::nlohmann_json) + target_link_libraries(${PROJECT_NAME} discord-rpc ssl crypto ws2_32 ssp crypt32 z + Dbghelp comsuppw minhook::minhook nlohmann_json nlohmann_json::nlohmann_json) endif(WIN32) add_definitions(-DELPP_NO_DEFAULT_LOG_FILE) target_include_directories(${PROJECT_NAME} PRIVATE "include") diff --git a/src/Discord.cpp b/src/Discord.cpp index d4ef1f8..627cf81 100644 --- a/src/Discord.cpp +++ b/src/Discord.cpp @@ -2,12 +2,13 @@ /// Created by Anonymous275 on 1/18/22 /// Copyright (c) 2021-present Anonymous275 read the LICENSE file for more info. /// - +#ifndef DEBUG #include #include "Launcher.h" #include "Logger.h" #include + void handleReady(const DiscordUser* u) {} void handleDisconnected(int errcode, const char* message) {} void handleError(int errcode, const char* message) { @@ -50,3 +51,14 @@ void Launcher::RichPresence() { void Launcher::RunDiscordRPC() { DiscordRPC = std::thread(&Launcher::RichPresence, this); } +#else +#include "Launcher.h" +void Launcher::setDiscordMessage(const std::string& message) { + DiscordMessage = message; +} +void Launcher::RunDiscordRPC() { + DiscordRPC = std::thread(&Launcher::RichPresence, this); +} +void Launcher::RichPresence() {}; +void Launcher::UpdatePresence() {}; +#endif \ No newline at end of file