diff --git a/README.md b/README.md index a7d117f..6f1121e 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,12 @@ PRs/feedback welcome if you have an improvement everyone might want. ## Usage There's a CMake file that should be able to generate the lib for you; I use it like this: -``` +```sh cd /path/to/discord-rpc mkdir build cd build cmake .. - cmake --build . + cmake --build . --config Release ``` Sometimes I use the generated project files. diff --git a/include/discord-rpc.h b/include/discord-rpc.h index 37f389c..18c3014 100644 --- a/include/discord-rpc.h +++ b/include/discord-rpc.h @@ -1,8 +1,6 @@ #pragma once #include -//#define DISCORD_DISABLE_IO_THREAD - #ifdef __cplusplus extern "C" { #endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 56e18ae..4b7ad29 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,11 @@ include_directories(${PROJECT_SOURCE_DIR}/include) +option(ENABLE_IO_THREAD "Start up a separate I/O thread, otherwise I'd need to call an update function" ON) + +if (${ENABLE_IO_THREAD} EQUAL OFF) + add_definitions(-DDISCORD_DISABLE_IO_THREAD) +endif (${ENABLE_IO_THREAD} EQUAL OFF) + set(BASE_RPC_SRC ${PROJECT_SOURCE_DIR}/include/discord-rpc.h discord-rpc.cpp rpc_connection.h rpc_connection.cpp serialization.h serialization.cpp connection.h backoff.h) if(WIN32)