diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e2c5513..e4e2141e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/vendor/POCO/cmake) # Several plugin options option(ENABLE_API21 "Build for 2.1 API." OFF) option(ENABLE_DISCORD "Enable built-in Discord support" ON) +option(ENABLE_DISCORD_VOICE "Enable voice support in Discord library" OFF) option(ENABLE_OFFICIAL "Enable compatibility with official legacy plug-in" ON) #option(FORCE_32BIT_BIN "Create a 32-bit executable binary if the compiler defaults to 64-bit." OFF) # This option should only be available in certain conditions diff --git a/vendor/DPP/CMakeLists.txt b/vendor/DPP/CMakeLists.txt index 0069bd56..18bb409f 100644 --- a/vendor/DPP/CMakeLists.txt +++ b/vendor/DPP/CMakeLists.txt @@ -149,23 +149,26 @@ find_package(OpenSSL REQUIRED) target_link_libraries(DPP PUBLIC Threads::Threads ZLIB::ZLIB OpenSSL::Crypto OpenSSL::SSL) # Include the custom module folder set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/") -# Look for sodium and opus libraries -include("cmake/FindSodium.cmake") -include("cmake/FindOpus.cmake") -# Was the opus library found? -if(DEFINED OPUS_FOUND) - message(STATUS "Opus library was found") - # Link to opus library - target_include_directories(DPP PUBLIC ${OPUS_INCLUDE_DIRS}) - target_link_libraries(DPP PUBLIC ${OPUS_LIBRARIES}) - # Was the sodium library found? - if(DEFINED sodium_VERSION_STRING) - message(STATUS "Sodium library was found") - message(STATUS "DPP voice support enabled") - # Let the code know about this - target_compile_definitions(DPP PRIVATE HAVE_VOICE=1) - # Link to sodium library - target_include_directories(DPP PUBLIC ${sodium_INCLUDE_DIR}) - target_link_libraries(DPP PUBLIC ${sodium_LIBRARY_RELEASE}) +# Enable voice support in discord library +if (ENABLE_DISCORD_VOICE) + # Look for sodium and opus libraries + include("cmake/FindSodium.cmake") + include("cmake/FindOpus.cmake") + # Was the opus library found? + if(DEFINED OPUS_FOUND) + message(STATUS "Opus library was found") + # Link to opus library + target_include_directories(DPP PUBLIC ${OPUS_INCLUDE_DIRS}) + target_link_libraries(DPP PUBLIC ${OPUS_LIBRARIES}) + # Was the sodium library found? + if(DEFINED sodium_VERSION_STRING) + message(STATUS "Sodium library was found") + message(STATUS "DPP voice support enabled") + # Let the code know about this + target_compile_definitions(DPP PRIVATE HAVE_VOICE=1) + # Link to sodium library + target_include_directories(DPP PUBLIC ${sodium_INCLUDE_DIR}) + target_link_libraries(DPP PUBLIC ${sodium_LIBRARY_RELEASE}) + endif() endif() endif()