Commented unused library, Debug build fix

This commit is contained in:
Anonymous275 2022-07-22 14:43:56 +03:00
parent 17cea23381
commit c1ed5184e7
2 changed files with 25 additions and 7 deletions

View File

@ -23,7 +23,7 @@ set(wxBUILD_SHARED OFF)
set(wxBUILD_MSVC_MULTIPROC ON) set(wxBUILD_MSVC_MULTIPROC ON)
set(wxBUILD_USE_STATIC_RUNTIME ON) set(wxBUILD_USE_STATIC_RUNTIME ON)
add_subdirectory(include/wxWidgets) #add_subdirectory(include/wxWidgets)
add_subdirectory(include/cpp-httplib) add_subdirectory(include/cpp-httplib)
add_subdirectory(include/tomlplusplus) add_subdirectory(include/tomlplusplus)
@ -40,7 +40,8 @@ add_executable(${PROJECT_NAME}
src/Memory/GELua.cpp include/Memory/GELua.h src/Memory/GELua.cpp include/Memory/GELua.h
src/Memory/IPC.cpp include/Memory/IPC.h src/Memory/IPC.cpp include/Memory/IPC.h
src/Logger.cpp include/Logger.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/gui/gifs.cpp src/gui/gifs.h
src/Network/Http.cpp include/Http.h src/Network/Http.cpp include/Http.h
src/Network/Server.cpp include/Server.h src/Network/Server.cpp include/Server.h
@ -50,14 +51,19 @@ add_executable(${PROJECT_NAME}
src/Discord.cpp src/Config.cpp src/Discord.cpp src/Config.cpp
) )
if (WIN32) if (WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE ${VcpkgRoot}/lib/discord-rpc.lib if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
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) 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 else(WIN32) #MINGW
add_definitions("-D_WIN32_WINNT=0x0600") add_definitions("-D_WIN32_WINNT=0x0600")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -s --static") 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) endif(WIN32)
add_definitions(-DELPP_NO_DEFAULT_LOG_FILE) add_definitions(-DELPP_NO_DEFAULT_LOG_FILE)
target_include_directories(${PROJECT_NAME} PRIVATE "include") target_include_directories(${PROJECT_NAME} PRIVATE "include")

View File

@ -2,12 +2,13 @@
/// Created by Anonymous275 on 1/18/22 /// Created by Anonymous275 on 1/18/22
/// Copyright (c) 2021-present Anonymous275 read the LICENSE file for more info. /// Copyright (c) 2021-present Anonymous275 read the LICENSE file for more info.
/// ///
#ifndef DEBUG
#include <discord_rpc.h> #include <discord_rpc.h>
#include "Launcher.h" #include "Launcher.h"
#include "Logger.h" #include "Logger.h"
#include <ctime> #include <ctime>
void handleReady(const DiscordUser* u) {} void handleReady(const DiscordUser* u) {}
void handleDisconnected(int errcode, const char* message) {} void handleDisconnected(int errcode, const char* message) {}
void handleError(int errcode, const char* message) { void handleError(int errcode, const char* message) {
@ -50,3 +51,14 @@ void Launcher::RichPresence() {
void Launcher::RunDiscordRPC() { void Launcher::RunDiscordRPC() {
DiscordRPC = std::thread(&Launcher::RichPresence, this); 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