Skip to content

Commit

Permalink
- Enable Discord RPC building in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hbirchtree committed Nov 12, 2019
1 parent 8110845 commit 4c0cdc9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ secrets:
appveyor: 6ME8msH/BDLiEde9wCb9+GQRN4rcAzyu1Vx/wP5yHejedO3vPlrOXHiWqhjNqXrQ
template_location: toolchain/cmake/Templates
version:
hotfix: 18
hotfix: 19
major: 4
minor: 4
patch: 10
Expand Down
2 changes: 1 addition & 1 deletion examples/discord/basic/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ i32 cmain(i32 argc, cstring_w* argv)

u32 count = 0;

while(count < 100)
while(count < 1000000)
{
service->poll();
CurrentThread::sleep_for(Chrono::milliseconds(100));
Expand Down
7 changes: 3 additions & 4 deletions examples/gleam/rhi/base-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ coffee_application (

if(TARGET ASIO)
target_link_libraries ( GLeamBaseTest_RHI PUBLIC ASIO )
endif()

if(TARGET DiscordLatte)
target_link_libraries ( GLeamBaseTest_RHI PUBLIC DiscordLatte )
if(TARGET DiscordLatte)
target_link_libraries ( GLeamBaseTest_RHI PUBLIC DiscordLatte )
endif()
endif()
11 changes: 6 additions & 5 deletions examples/gleam/rhi/base-test/renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#include <coffee/core/CDebug>

#undef FEATURE_ENABLE_ASIO

//#define USE_NULL_RENDERER

using namespace Coffee;
Expand Down Expand Up @@ -537,6 +535,7 @@ void SetupRendering(CDRenderer& renderer, RendererState* d)
Chrono::milliseconds(100),
[mainQueue, &discord, &network, &imgCoder, &mainSurface]() {
ProfContext _("Awaiting Discord");
cDebug("Waiting for discord...");
if(discord.awaitReady(Chrono::milliseconds(10)))
{
cDebug("User ID: {0}", discord.playerInfo().userTag);
Expand All @@ -561,17 +560,19 @@ void SetupRendering(CDRenderer& renderer, RendererState* d)
});
}

discord.game().put(platform::online::GameDelegate::Builder(
"Cool Game", "Gaming", MkUrl("coffee_cup")));

runtime_queue_error ec;
RuntimeQueue::CancelTask(RuntimeQueue::GetSelfId(ec), ec);
}
},
rqec);

C_ERROR_CHECK(rqec);

discord.start();
}
// service->getPresence()->put({"", 1, 1, {}, {}});
// service->getGame()->put(platform::online::GameDelegate::Builder(
// {}, "Messing around", MkUrl("coffee_cup")));
#endif
#endif

Expand Down
2 changes: 2 additions & 0 deletions src/ext/discord/include/coffee/discord/discord_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ using Tag = Components::TagType<detail::DiscordData>;

struct Subsystem : Components::Globals::ValueSubsystem<Tag>
{
using tag_type = Tag;

Subsystem(RuntimeQueue* queue, DiscordOptions&& options) :
m_discordQueue(queue), m_options(std::move(options))
{
Expand Down
4 changes: 4 additions & 0 deletions toolchain/makers/Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,7 @@ ubuntu.amd64: FORCE
-DAPPIMAGE_RUNTIME_BINARY=$(NATIVE_LIBRARY_DIR)/Ubuntu/util/x86_64-linux-gnu/runtime \
-DBUILD_ASSIMP=ON \
-DBUILD_BINARIES=$(GENERATE_PROGRAMS) \
-DBUILD_DISCORD_RPC=ON \
-DCMAKE_BUILD_TYPE=$(CONFIGURATION) \
-DCMAKE_INSTALL_PREFIX=$(CMAKE_INSTALL_DIR)/ubuntu.amd64 \
-DCMAKE_TOOLCHAIN_FILE=$(CMAKE_SOURCE_DIR)/toolchain/cmake/Toolchains/linux-generic_linux.toolchain.cmake \
Expand Down Expand Up @@ -1286,6 +1287,7 @@ ubuntu.amd64.tools: FORCE
-DAPPIMAGE_RUNTIME_BINARY=$(NATIVE_LIBRARY_DIR)/Ubuntu/util/x86_64-linux-gnu/runtime \
-DBUILD_ASSIMP=ON \
-DBUILD_BINARIES=$(GENERATE_PROGRAMS) \
-DBUILD_DISCORD_RPC=ON \
-DBUILD_ETC2COMP=ON \
-DBUILD_EXAMPLES=OFF \
-DBUILD_HEADFUL=OFF \
Expand Down Expand Up @@ -1326,6 +1328,7 @@ ubuntu.amd64.gles2: FORCE
-DAPPIMAGE_RUNTIME_BINARY=$(NATIVE_LIBRARY_DIR)/Ubuntu/util/x86_64-linux-gnu/runtime \
-DBUILD_ASSIMP=ON \
-DBUILD_BINARIES=$(GENERATE_PROGRAMS) \
-DBUILD_DISCORD_RPC=ON \
-DCMAKE_BUILD_TYPE=$(CONFIGURATION) \
-DCMAKE_INSTALL_PREFIX=$(CMAKE_INSTALL_DIR)/ubuntu.amd64.gles2 \
-DCMAKE_TOOLCHAIN_FILE=$(CMAKE_SOURCE_DIR)/toolchain/cmake/Toolchains/linux-generic_linux.toolchain.cmake \
Expand Down Expand Up @@ -1357,6 +1360,7 @@ ubuntu.amd64.gles3: FORCE
-DAPPIMAGE_RUNTIME_BINARY=$(NATIVE_LIBRARY_DIR)/Ubuntu/util/x86_64-linux-gnu/runtime \
-DBUILD_ASSIMP=ON \
-DBUILD_BINARIES=$(GENERATE_PROGRAMS) \
-DBUILD_DISCORD_RPC=ON \
-DCMAKE_BUILD_TYPE=$(CONFIGURATION) \
-DCMAKE_INSTALL_PREFIX=$(CMAKE_INSTALL_DIR)/ubuntu.amd64.gles3 \
-DCMAKE_TOOLCHAIN_FILE=$(CMAKE_SOURCE_DIR)/toolchain/cmake/Toolchains/linux-generic_linux.toolchain.cmake \
Expand Down
2 changes: 2 additions & 0 deletions toolchain/makers/Makefile.mac
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ osx: FORCE
-C$(SOURCE_DIR)/toolchain/cmake/Preload/osx-generic.cmake \
-DBUILD_ASSIMP=ON \
-DBUILD_BINARIES=$(GENERATE_PROGRAMS) \
-DBUILD_DISCORD_RPC=ON \
-DBUILD_ETC2COMP=ON \
-DCMAKE_BUILD_TYPE=$(CONFIGURATION) \
-DCMAKE_INSTALL_PREFIX=$(BUILD_DIR)/build/osx \
Expand All @@ -147,6 +148,7 @@ osx.coverage: FORCE
-DBUILD_ASSIMP=ON \
-DBUILD_BINARIES=$(GENERATE_PROGRAMS) \
-DBUILD_COVERAGE=ON \
-DBUILD_DISCORD_RPC=ON \
-DBUILD_ETC2COMP=ON \
-DBUILD_EXAMPLES=OFF \
-DCMAKE_BUILD_TYPE=$(CONFIGURATION) \
Expand Down
3 changes: 3 additions & 0 deletions toolchain/makers/coffee-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,6 @@ gamecube.*:
.*(ubuntu|fedora|coverage|testing.linux|android|docs|steam|raspberry|emscripten|osx).*:
+cmake-opts:
- -DBUILD_ASSIMP=ON
(ubuntu.amd64|osx).*:
+cmake-opts:
- -DBUILD_DISCORD_RPC=ON

0 comments on commit 4c0cdc9

Please sign in to comment.