Teaspeak-Server/server/CMakeLists.txt

365 lines
11 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.6)
project(TeaSpeak-Server)
set(CMAKE_VERBOSE_MAKEFILE ON)
#--allow-multiple-definition
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -Wall -Wno-reorder -Wno-sign-compare -static-libgcc -static-libstdc++ -g -Wl,--no-whole-archive -pthread ${MEMORY_DEBUG_FLAGS} -Werror=return-type")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3")
#NDEBUG
#set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -O2")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/environment/)
#disable for debug
#add_definitions(-DRELEASE_MODE)
2020-01-30 06:06:39 -05:00
find_event(ON)
include_directories(../music/include/)
include_directories(../shared/src)
include_directories(../license/src)
include_directories(../MusicBot/src)
2020-02-14 15:56:36 -05:00
# include_directories(/usr/local/include/breakpad)
# include_directories(${LIBRARY_PATH}/tomcrypt/src/headers)
add_definitions(-DLTM_DESC)
add_definitions(-DMUSIC_BOT)
add_definitions(-DUSE_BORINGSSL)
#0 = STABLE
#1 = BETA
#2 = ALPHA
#3 = PRIVATE
option(BUILD_TYPE "Sets the build type" OFF)
option(BUILD_TYPE_NAME "Sets the build type name" OFF)
option(COMPILE_WEB_CLIENT "Enable/Disable the web cleint future" OFF)
2020-01-24 12:24:04 -05:00
#set(COMPILE_WEB_CLIENT "ON")
set(CMAKE_VERBOSE_MAKEFILE ON)
set(SERVER_SOURCE_FILES
2020-01-23 20:57:58 -05:00
main.cpp
tomcryptTest.cpp
2020-03-02 12:45:53 -05:00
# Only needed for boringssl
# MySQLLibSSLFix.c
2020-01-23 20:57:58 -05:00
src/client/ConnectedClient.cpp
src/server/PrecomputedPuzzles.cpp
2020-01-23 20:57:58 -05:00
src/client/voice/VoiceClient.cpp
src/client/voice/VoiceClientHandschake.cpp
src/client/voice/VoiceClientCommandHandler.cpp
src/client/voice/VoiceClientConnectionPacketHandler.cpp
2020-04-08 07:01:41 -04:00
src/client/voice/PacketStatistics.cpp
2020-01-23 20:57:58 -05:00
src/TS3ServerClientManager.cpp
2020-01-26 12:04:38 -05:00
src/VirtualServer.cpp
2020-05-13 05:32:08 -04:00
src/FileServerHandler.cpp
2020-01-23 20:57:58 -05:00
src/TS3ServerHeartbeat.cpp
src/SignalHandler.cpp
src/server/VoiceServer.cpp
src/server/POWHandler.cpp
src/client/voice/VoiceClientConnection.cpp
#src/client/ConnectedClientCommandHandler.cpp
src/client/command_handler/channel.cpp
src/client/command_handler/client.cpp
src/client/command_handler/server.cpp
src/client/command_handler/misc.cpp
2020-05-07 15:28:15 -04:00
src/client/command_handler/bulk_parsers.cpp
2020-01-23 20:57:58 -05:00
src/client/ConnectedClientNotifyHandler.cpp
2020-01-26 20:21:39 -05:00
src/VirtualServerManager.cpp
src/channel/ServerChannel.cpp
src/channel/ClientChannelView.cpp
2020-01-23 20:57:58 -05:00
src/Group.cpp
src/manager/BanManager.cpp
src/client/InternalClient.cpp
#src/weblist/WeblistClient.cpp
#src/weblist/WebList.cpp
2020-01-23 20:57:58 -05:00
src/client/DataClient.cpp
src/server/QueryServer.cpp
src/client/query/QueryClient.cpp
src/client/query/QueryClientCommands.cpp
src/client/query/QueryClientNotify.cpp
2020-01-23 20:57:58 -05:00
src/manager/IpListManager.cpp
2020-01-23 20:57:58 -05:00
src/ConnectionStatistics.cpp
2020-01-23 20:57:58 -05:00
src/manager/TokeManager.cpp
2020-01-23 20:57:58 -05:00
src/terminal/CommandHandler.cpp
2020-01-23 20:57:58 -05:00
src/manager/ComplainManager.cpp
src/DatabaseHelper.cpp
2020-01-23 20:57:58 -05:00
src/manager/LetterManager.cpp
src/manager/PermissionNameManager.cpp
2020-01-23 20:57:58 -05:00
src/ServerManagerSnapshot.cpp
src/ServerManagerSnapshotDeploy.cpp
src/client/music/Song.cpp
src/music/PlayablePlaylist.cpp
src/InstanceHandler.cpp
src/InstanceHandlerSetup.cpp
2020-01-23 20:57:58 -05:00
src/Configuration.cpp
2020-01-23 20:57:58 -05:00
src/build.cpp
2020-01-23 20:57:58 -05:00
src/music/MusicPlaylist.cpp
src/client/music/MusicClient.cpp
src/client/music/MusicClientPlayer.cpp
src/client/ConnectedClientTextCommandHandler.cpp
src/music/MusicBotManager.cpp
src/client/music/internal_provider/channel_replay/ChannelProvider.cpp
2020-01-23 20:57:58 -05:00
src/geo/GeoLocation.cpp
src/geo/IP2Location.cpp
src/geo/VPNBlocker.cpp
2020-01-23 20:57:58 -05:00
src/client/query/XMacroEventTypes.h
2020-01-23 20:57:58 -05:00
src/server/VoiceIOManager.cpp
src/server/WebIoManager.cpp
src/client/SpeakingClient.cpp
2020-01-23 20:57:58 -05:00
../shared/src/ssl/SSLManager.cpp
2020-01-23 20:57:58 -05:00
src/manager/SqlDataManager.cpp
2020-01-23 20:57:58 -05:00
src/ShutdownHelper.cpp
src/client/music/MusicQueue.cpp
src/lincense/TeamSpeakLicense.cpp
2020-01-23 20:57:58 -05:00
src/weblist/WebListManager.cpp
src/weblist/TeamSpeakWebClient.cpp
2020-04-14 05:49:07 -04:00
src/snapshots/permission.cpp
src/snapshots/client.cpp
src/snapshots/channel.cpp
src/snapshots/server.cpp
src/snapshots/groups.cpp
src/snapshots/deploy.cpp
src/snapshots/music.cpp
src/snapshots/parser.cpp
2020-04-14 05:49:07 -04:00
2020-06-28 08:01:14 -04:00
src/manager/ActionLogger.cpp
src/manager/ActionLoggerImpl.cpp
2020-01-23 20:57:58 -05:00
src/manager/ConversationManager.cpp
2020-01-24 12:24:04 -05:00
src/client/SpeakingClientHandshake.cpp
src/client/command_handler/music.cpp src/client/command_handler/file.cpp
src/client/voice/PacketDecoder.cpp
src/client/voice/PacketEncoder.cpp
src/client/voice/ServerCommandExecutor.cpp
src/client/voice/PingHandler.cpp
src/client/voice/CryptSetupHandler.cpp
2020-07-31 17:18:01 -04:00
src/terminal/PipedTerminal.cpp
src/server/voice/UDPVoiceServer.cpp
src/server/voice/DatagramPacket.cpp
2020-11-07 07:17:51 -05:00
src/rtc/lib.cpp
)
if (COMPILE_WEB_CLIENT)
2020-01-23 20:57:58 -05:00
add_definitions(-DCOMPILE_WEB_CLIENT)
set(SERVER_SOURCE_FILES
${SERVER_SOURCE_FILES}
src/server/WebServer.cpp
src/client/web/WebClient.cpp
src/client/web/WSWebClient.cpp
2020-02-28 05:24:07 -05:00
src/client/command_handler/helpers.h src/music/PlaylistPermissions.cpp src/music/PlaylistPermissions.h src/lincense/LicenseService.cpp src/lincense/LicenseService.h)
endif ()
add_executable(PermHelper helpers/permgen.cpp)
target_link_libraries(PermHelper
2020-01-23 20:57:58 -05:00
${LIBRARY_PATH_ED255}
TeaSpeak #Static
TeaLicenseHelper #Static
TeaMusic #Static
${LIBRARY_PATH_THREAD_POOL} #Static
${LIBRARY_PATH_TERMINAL} #Static
${LIBRARY_PATH_VARIBALES}
${LIBRARY_PATH_YAML}
pthread
stdc++fs
${LIBEVENT_PATH}/libevent.a
${LIBEVENT_PATH}/libevent_pthreads.a
${LIBRARY_PATH_OPUS}
${LIBRARY_PATH_JSON}
${LIBRARY_PATH_PROTOBUF}
#${LIBWEBRTC_LIBRARIES} #ATTENTIAN! WebRTC does not work with crypto! (Already contains a crypto version)
${LIBRARY_TOM_CRYPT}
${LIBRARY_TOM_MATH}
#We're forsed to use boringssl caused by the fact that boringssl is already within webrtc!
#Require a so
sqlite3
${LIBRARY_PATH_BREAKPAD}
${LIBRARY_PATH_JDBC}
${LIBRARY_PATH_PROTOBUF}
${LIBRARY_PATH_DATA_PIPES}
${LIBRARY_PATH_BORINGSSL_SSL}
${LIBRARY_PATH_BORINGSSL_CRYPTO}
dl
jemalloc
)
2019-08-25 17:55:55 -04:00
add_executable(PermMapHelper helpers/PermMapGen.cpp)
target_link_libraries(PermMapHelper
2020-01-23 20:57:58 -05:00
${LIBRARY_PATH_ED255}
TeaSpeak #Static
TeaLicenseHelper #Static
TeaMusic #Static
${LIBRARY_PATH_THREAD_POOL} #Static
${LIBRARY_PATH_TERMINAL} #Static
${LIBRARY_PATH_VARIBALES}
${LIBRARY_PATH_YAML}
pthread
stdc++fs
${LIBEVENT_PATH}/libevent.a
${LIBEVENT_PATH}/libevent_pthreads.a
${LIBRARY_PATH_OPUS}
${LIBRARY_PATH_JSON}
${LIBRARY_PATH_PROTOBUF}
#${LIBWEBRTC_LIBRARIES} #ATTENTIAN! WebRTC does not work with crypto! (Already contains a crypto version)
${LIBRARY_TOM_CRYPT}
${LIBRARY_TOM_MATH}
#We're forsed to use boringssl caused by the fact that boringssl is already within webrtc!
#Require a so
sqlite3
${LIBRARY_PATH_BREAKPAD}
${LIBRARY_PATH_JDBC}
${LIBRARY_PATH_PROTOBUF}
${LIBRARY_PATH_DATA_PIPES}
${LIBRARY_PATH_BORINGSSL_SSL}
${LIBRARY_PATH_BORINGSSL_CRYPTO}
dl
jemalloc
)
2019-08-25 17:55:55 -04:00
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
2020-11-07 07:17:51 -05:00
SET(CPACK_PACKAGE_VERSION_MINOR "5")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
if (BUILD_TYPE_NAME EQUAL OFF)
SET(CPACK_PACKAGE_VERSION_DATA "beta")
elseif (BUILD_TYPE_NAME STREQUAL "")
SET(CPACK_PACKAGE_VERSION_DATA "")
else ()
SET(CPACK_PACKAGE_VERSION_DATA "-${BUILD_TYPE_NAME}")
endif ()
2020-01-24 12:26:32 -05:00
if (NOT BUILD_TYPE AND NOT BUILD_TYPE STREQUAL "0")
2020-01-24 16:55:23 -05:00
SET(BUILD_TYPE "3")
endif ()
set_source_files_properties(src/build.cpp PROPERTIES
2020-01-23 20:57:58 -05:00
COMPILE_FLAGS "-DBUILD_MAJOR=${CPACK_PACKAGE_VERSION_MAJOR} -DBUILD_MINOR=${CPACK_PACKAGE_VERSION_MINOR} -DBUILD_PATCH=${CPACK_PACKAGE_VERSION_PATCH} -DBUILD_DATA=\"${CPACK_PACKAGE_VERSION_DATA}\" -DBUILD_TYPE=${BUILD_TYPE} -DBUILD_COUNT=0")
file(WRITE repro/env/buildVersion.txt "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}${CPACK_PACKAGE_VERSION_DATA}")
add_executable(TeaSpeakServer ${SERVER_SOURCE_FILES})
target_link_libraries(TeaSpeakServer
threadpool::static #Static
2020-01-23 20:57:58 -05:00
TeaSpeak #Static
TeaLicenseHelper #Static
TeaMusic #Static
CXXTerminal::static #Static
2020-05-13 05:32:08 -04:00
TeaSpeak-FileServer
${StringVariable_LIBRARIES_STATIC}
${YAML_CPP_LIBRARIES}
2020-01-23 20:57:58 -05:00
pthread
stdc++fs
2020-01-24 11:06:52 -05:00
libevent::core libevent::pthreads
opus::static
yaml-cpp
2020-01-23 20:57:58 -05:00
#Require a so
sqlite3
2020-11-10 10:59:54 -05:00
DataPipes::core::static
2020-01-23 20:57:58 -05:00
breakpad::static
protobuf::libprotobuf
jemalloc::shared
2020-01-23 20:57:58 -05:00
tomcrypt::static
tommath::static
2020-01-23 20:57:58 -05:00
jsoncpp_lib
${ed25519_LIBRARIES_STATIC}
2020-07-31 11:35:14 -04:00
zstd::libzstd_static
2020-01-25 08:37:59 -05:00
)
2020-01-23 20:57:58 -05:00
2020-11-10 10:59:54 -05:00
if(EXISTS "${CMAKE_SOURCE_DIR}/rtclib/libteaspeak_rtc.so" AND NOT NO_RELEASE_RTC)
2020-11-10 09:44:07 -05:00
message("Linking to release librtc file")
target_link_libraries(TeaSpeakServer
2020-11-10 10:59:54 -05:00
${CMAKE_SOURCE_DIR}/rtclib/libteaspeak_rtc.so
2020-11-10 09:44:07 -05:00
)
elseif(EXISTS "${CMAKE_SOURCE_DIR}/rtclib/target/debug/libteaspeak_rtc.so")
message("Linkding against debug libteaspeak_rtc.so")
target_link_libraries(TeaSpeakServer
${CMAKE_SOURCE_DIR}/rtclib/target/debug/libteaspeak_rtc.so
)
else()
message(FATAL_ERROR "Missing librtc library file")
endif()
2020-01-26 11:27:09 -05:00
2020-03-02 12:45:53 -05:00
# include_directories(${LIBRARY_PATH}/boringssl/include/)
target_link_libraries(TeaSpeakServer
openssl::ssl::shared
openssl::crypto::shared
2020-01-23 20:57:58 -05:00
dl
z
2020-02-16 09:06:00 -05:00
rt # For clock_gettime
2020-02-15 08:03:46 -05:00
)
2020-02-16 06:04:23 -05:00
#check_include_file(mysql.h HAVE_MYSQL_MYSQL_H)
#if (NOT HAVE_MYSQL_MYSQL_H)
# check_include_file(mysql.h HAVE_MYSQL_H)
# if (NOT HAVE_MYSQL_H)
# message(FATAL_ERROR "Missing MySQL header")
# endif ()
#endif ()
set(DISABLE_JEMALLOC ON)
if (NOT DISABLE_JEMALLOC)
2020-01-23 20:57:58 -05:00
target_link_libraries(TeaSpeakServer
jemalloc
2020-02-16 09:06:00 -05:00
)
2020-01-23 20:57:58 -05:00
add_definitions(-DHAVE_JEMALLOC)
2020-04-14 05:49:07 -04:00
endif ()
add_executable(Snapshots-Permissions-Test src/snapshots/permission.cpp tests/snapshots/permission.cpp)
target_link_libraries(Snapshots-Permissions-Test PUBLIC
TeaSpeak
CXXTerminal::static #Static
${StringVariable_LIBRARIES_STATIC}
${YAML_CPP_LIBRARIES}
pthread
stdc++fs
libevent::core libevent::pthreads
#Require a so
sqlite3
DataPipes::rtc::shared
tomcrypt::static
tommath::static
${glib20_DIR}/lib/x86_64-linux-gnu/libffi.so.7 ${nice_DIR}/lib/libnice.so.10
)
2020-11-10 10:59:54 -05:00
target_include_directories(Snapshots-Permissions-Test PUBLIC ${CMAKE_SOURCE_DIR}/server/src/)