1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Make Discord voice support explicit.

This commit is contained in:
Sandu Liviu Catalin 2021-09-10 20:19:25 +03:00
parent 4f70f89b78
commit 60467782e3
2 changed files with 22 additions and 18 deletions

View File

@ -13,6 +13,7 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/vendor/POCO/cmake)
# Several plugin options # Several plugin options
option(ENABLE_API21 "Build for 2.1 API." OFF) option(ENABLE_API21 "Build for 2.1 API." OFF)
option(ENABLE_DISCORD "Enable built-in Discord support" ON) 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(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) #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 # This option should only be available in certain conditions

View File

@ -149,23 +149,26 @@ find_package(OpenSSL REQUIRED)
target_link_libraries(DPP PUBLIC Threads::Threads ZLIB::ZLIB OpenSSL::Crypto OpenSSL::SSL) target_link_libraries(DPP PUBLIC Threads::Threads ZLIB::ZLIB OpenSSL::Crypto OpenSSL::SSL)
# Include the custom module folder # Include the custom module folder
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/")
# Look for sodium and opus libraries # Enable voice support in discord library
include("cmake/FindSodium.cmake") if (ENABLE_DISCORD_VOICE)
include("cmake/FindOpus.cmake") # Look for sodium and opus libraries
# Was the opus library found? include("cmake/FindSodium.cmake")
if(DEFINED OPUS_FOUND) include("cmake/FindOpus.cmake")
message(STATUS "Opus library was found") # Was the opus library found?
# Link to opus library if(DEFINED OPUS_FOUND)
target_include_directories(DPP PUBLIC ${OPUS_INCLUDE_DIRS}) message(STATUS "Opus library was found")
target_link_libraries(DPP PUBLIC ${OPUS_LIBRARIES}) # Link to opus library
# Was the sodium library found? target_include_directories(DPP PUBLIC ${OPUS_INCLUDE_DIRS})
if(DEFINED sodium_VERSION_STRING) target_link_libraries(DPP PUBLIC ${OPUS_LIBRARIES})
message(STATUS "Sodium library was found") # Was the sodium library found?
message(STATUS "DPP voice support enabled") if(DEFINED sodium_VERSION_STRING)
# Let the code know about this message(STATUS "Sodium library was found")
target_compile_definitions(DPP PRIVATE HAVE_VOICE=1) message(STATUS "DPP voice support enabled")
# Link to sodium library # Let the code know about this
target_include_directories(DPP PUBLIC ${sodium_INCLUDE_DIR}) target_compile_definitions(DPP PRIVATE HAVE_VOICE=1)
target_link_libraries(DPP PUBLIC ${sodium_LIBRARY_RELEASE}) # Link to sodium library
target_include_directories(DPP PUBLIC ${sodium_INCLUDE_DIR})
target_link_libraries(DPP PUBLIC ${sodium_LIBRARY_RELEASE})
endif()
endif() endif()
endif() endif()