From 70f9886d3c0611ee8d6c922c85ccd3d12dd113db Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Mon, 7 Aug 2023 20:43:56 +0300 Subject: [PATCH] Add discord-rpc submodule --- .gitmodules | 3 +++ CMakeLists.txt | 10 ++++++++++ third_party/discord-rpc | 1 + 3 files changed, 14 insertions(+) create mode 160000 third_party/discord-rpc diff --git a/.gitmodules b/.gitmodules index 30c0036e..1fb0fcca 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,6 @@ [submodule "third_party/glm"] path = third_party/glm url = https://github.com/g-truc/glm +[submodule "third_party/discord-rpc"] + path = third_party/discord-rpc + url = https://github.com/discord/discord-rpc diff --git a/CMakeLists.txt b/CMakeLists.txt index c5725ff0..16f530a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ option(ENABLE_VULKAN "Enable Vulkan rendering backend" ON) option(ENABLE_LTO "Enable link-time optimization" OFF) option(ENABLE_USER_BUILD "Make a user-facing build. These builds have various assertions disabled, LTO, and more" OFF) option(ENABLE_HTTP_SERVER "Enable HTTP server. Used for Discord bot support" OFF) +option(ENABLE_DISCORD_RPC "Compile with Discord RPC support (disabled by default)" ON) include_directories(${PROJECT_SOURCE_DIR}/include/) include_directories(${PROJECT_SOURCE_DIR}/include/kernel) @@ -43,6 +44,11 @@ add_compile_definitions(NOMINMAX) # Make windows.h not define min/ma add_compile_definitions(WIN32_LEAN_AND_MEAN) # Make windows.h not include literally everything add_compile_definitions(SDL_MAIN_HANDLED) +if(ENABLE_DISCORD_RPC) + add_subdirectory(third_party/discord-rpc) + include_directories(third_party/discord-rpc/include) +endif() + set(SDL_STATIC ON CACHE BOOL "" FORCE) set(SDL_SHARED OFF CACHE BOOL "" FORCE) set(SDL_TEST OFF CACHE BOOL "" FORCE) @@ -256,6 +262,10 @@ endif() target_link_libraries(Alber PRIVATE dynarmic SDL2-static cryptopp glad) +if(ENABLE_DISCORD_RPC) + target_compile_definitions(Alber PUBLIC "PANDA3DS_ENABLE_DISCORD_RPC=1") +endif() + if(ENABLE_OPENGL) target_compile_definitions(Alber PUBLIC "PANDA3DS_ENABLE_OPENGL=1") target_link_libraries(Alber PRIVATE resources_renderer_gl) diff --git a/third_party/discord-rpc b/third_party/discord-rpc new file mode 160000 index 00000000..963aa9f3 --- /dev/null +++ b/third_party/discord-rpc @@ -0,0 +1 @@ +Subproject commit 963aa9f3e5ce81a4682c6ca3d136cddda614db33