TeaSpeak-Client/native/serverconnection/CMakeLists.txt

142 lines
3.6 KiB
CMake
Raw Normal View History

2019-06-26 16:09:01 -04:00
set(MODULE_NAME "teaclient_connection")
2019-08-21 04:00:27 -04:00
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -lasan -lubsan")
2019-06-26 16:09:01 -04:00
set(SOURCE_FILES
src/logger.cpp
src/EventLoop.cpp
src/connection/ft/FileTransferManager.cpp
src/connection/ft/FileTransferObject.cpp
src/audio/AudioSamples.cpp
src/audio/AudioDevice.cpp
src/audio/AudioMerger.cpp
src/audio/AudioOutput.cpp
src/audio/AudioInput.cpp
src/audio/AudioResampler.cpp
src/audio/AudioReframer.cpp
src/audio/filter/FilterVad.cpp
src/audio/filter/FilterThreshold.cpp
src/audio/filter/FilterState.cpp
src/audio/codec/Converter.cpp
src/audio/codec/OpusConverter.cpp
)
set(NODEJS_SOURCE_FILES
src/bindings.cpp
src/connection/ServerConnection.cpp
src/connection/Socket.cpp
src/connection/ProtocolHandler.cpp
src/connection/ProtocolHandlerPOW.cpp
src/connection/ProtocolHandlerCrypto.cpp
src/connection/ProtocolHandlerPackets.cpp
src/connection/ProtocolHandlerCommands.cpp
src/connection/audio/AudioSender.cpp
src/connection/audio/AudioEventLoop.cpp
src/connection/audio/VoiceConnection.cpp
src/connection/audio/VoiceClient.cpp
src/audio/js/AudioPlayer.cpp
src/audio/js/AudioOutputStream.cpp
src/audio/js/AudioRecorder.cpp
src/audio/js/AudioConsumer.cpp
src/audio/js/AudioFilter.cpp
)
if (MSVC)
set(SOURCE_FILES ${SOURCE_FILES})
add_definitions(-DUSING_UV_SHARED)
else()
set(SOURCE_FILES ${SOURCE_FILES})
endif()
add_nodejs_module(${MODULE_NAME} ${SOURCE_FILES} ${NODEJS_SOURCE_FILES})
target_link_libraries(${MODULE_NAME} ${NODEJS_LIBRARIES})
2019-07-02 15:55:37 -04:00
find_package(TomMath REQUIRED)
include_directories(${TomMath_INCLUDE_DIR})
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(TomCrypt REQUIRED)
include_directories(${TomCrypt_INCLUDE_DIR})
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(DataPipes REQUIRED)
include_directories(${DataPipes_INCLUDE_DIR})
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(Libevent REQUIRED)
include_directories(${LIBEVENT_INCLUDE_DIRS})
2019-07-06 09:38:31 -04:00
message("libevent include dir: ${LIBEVENT_INCLUDE_DIRS}")
message("libevent static libraries: ${LIBEVENT_STATIC_LIBRARIES}")
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(TeaSpeak_SharedLib REQUIRED)
include_directories(${TeaSpeak_SharedLib_INCLUDE_DIR})
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(StringVariable REQUIRED)
include_directories(${StringVariable_INCLUDE_DIR})
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(Ed25519 REQUIRED)
include_directories(${ed25519_INCLUDE_DIR})
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(ThreadPool REQUIRED)
include_directories(${ThreadPool_INCLUDE_DIR})
if (WIN32)
add_definitions(-DWINDOWS) #Required by ThreadPool
endif ()
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(Soxr REQUIRED)
include_directories(${soxr_INCLUDE_DIR})
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(PortAudio REQUIRED)
include_directories(${PortAudio_INCLUDE_DIR})
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(fvad REQUIRED)
include_directories(${fvad_INCLUDE_DIR})
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(Opus REQUIRED)
include_directories(${opus_INCLUDE_DIR})
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
find_package(spdlog REQUIRED)
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
set(REQUIRED_LIBRARIES
${TeaSpeak_SharedLib_LIBRARIES_STATIC}
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
${TomCrypt_LIBRARIES_STATIC}
${TomMath_LIBRARIES_STATIC}
2019-06-26 16:09:01 -04:00
2019-07-05 15:44:18 -04:00
${LIBEVENT_STATIC_LIBRARIES}
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
${StringVariable_LIBRARIES_STATIC}
${DataPipes_LIBRARIES_STATIC} #Needs to be static because something causes ca bad function call when loaded in electron
${ThreadPool_LIBRARIES_STATIC}
${soxr_LIBRARIES_STATIC}
${PortAudio_LIBRARIES_STATIC}
${fvad_LIBRARIES_STATIC}
${opus_LIBRARIES_STATIC}
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
${ed25519_LIBRARIES_STATIC}
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
spdlog::spdlog
)
2019-06-26 16:09:01 -04:00
2019-07-02 15:55:37 -04:00
if (WIN32)
set(REQUIRED_LIBRARIES ${REQUIRED_LIBRARIES} "Ws2_32.Lib")
else()
set(REQUIRED_LIBRARIES ${REQUIRED_LIBRARIES}
2019-07-06 09:38:31 -04:00
libstdc++fs.a
2019-06-26 16:09:01 -04:00
asound
jack
pthread
)
endif()
add_definitions(-DNO_OPEN_SSL)
target_link_libraries(${MODULE_NAME} ${REQUIRED_LIBRARIES})
target_compile_definitions(${MODULE_NAME} PUBLIC -DNODEJS_API)
add_executable(Audio-Test ${SOURCE_FILES} test/audio/main.cpp)
2019-07-06 09:38:31 -04:00
target_link_libraries(Audio-Test ${REQUIRED_LIBRARIES})