diff --git a/CMakeLists.txt b/CMakeLists.txt index 18853f2..9be3059 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,11 +57,17 @@ resolve_library(LIBRARY_PATH_ED255 OFF "${LIBRARY_PATH}/ed25519/bui resolve_library(LIBRARY_PATH_DATA_PIPES OFF "${LIBRARY_PATH}/DataPipes/build/libDataPipes.so" "${LIBRARY_PATH}/DataPipes/cmake-build-release/libDataPipes.so" "${LIBRARY_PATH}/DataPipes/cmake-build-debug/libDataPipes.so") resolve_library(LIBRARY_PATH_OPUS OFF "${LIBRARY_PATH}/opus/build/.libs/libopus.a") resolve_library(LIBRARY_PATH_NICE OFF "${LIBRARY_PATH}/libnice/linux_${BUILD_OS_ARCH}/lib/libnice.so.10") -include_directories(${LIBRARY_PATH}/libnice/linux_${BUILD_OS_ARCH}/include) -include_directories(${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/include) -include_directories(${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/include/glib-2.0) -include_directories(${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/lib/x86_64-linux-gnu/glib-2.0/include/) -include_directories(${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/lib/i386-linux-gnu/glib-2.0/include/) +message("Found libnice at ${LIBRARY_PATH_NICE}") + +if (EXISTS "${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/lib/i386-linux-gnu/") + set(GLIBC_LIB_DIR "${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/lib/i386-linux-gnu/") +elseif(EXISTS "${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/lib/x86_64-linux-gnu/") + set(GLIBC_LIB_DIR "${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/lib/x86_64-linux-gnu/") +else() + message(FATAL_ERROR "Failed to find glibc") +endif () +message("Found GLIBC lib dir at ${GLIBC_LIB_DIR}") +#set(LIBRARY_PATH_GLIBC "${GLIBC_LIB_DIR}/libglib-2.0.a;${GLIBC_LIB_DIR}/libgobject-2.0.a;${GLIBC_LIB_DIR}/libffi.a") add_definitions(-DINET -DINET6) add_subdirectory(shared/) diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 7fbe898..45393db 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -3,7 +3,7 @@ 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,--no-undefined -pthread ${MEMORY_DEBUG_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -Wall -Wno-reorder -Wno-sign-compare -static-libgcc -static-libstdc++ -g -Wl,-no-whole-archive,--allow-shlib-undefined -pthread ${MEMORY_DEBUG_FLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3") @@ -268,14 +268,12 @@ target_link_libraries(TeaSpeakServer ${LIBRARY_PATH_BREAKPAD} ${LIBRARY_PATH_PROTOBUF} - ${LIBRARY_PATH_NICE} #${LIBWEBRTC_LIBRARIES} #ATTENTIAN! WebRTC does not work with crypto! (Already contains a crypto version) ${LIBRARY_TOM_CRYPT} ${LIBRARY_TOM_MATH} mysqlclient.a - z ${LIBRARY_PATH_ED255} ) @@ -285,12 +283,15 @@ if(${COMPILE_WEB_CLIENT}) target_link_libraries(TeaSpeakServer ${LIBRARY_PATH_DATA_PIPES} ) + + target_link_options(TeaSpeakServer PUBLIC "-Wl,--no-as-needed" "${LIBRARY_PATH_NICE}" "-Wl,--as-needed") endif() include_directories(${LIBRARY_PATH}/boringssl/include/) target_link_libraries(TeaSpeakServer ${LIBRARY_PATH_BORINGSSL_SSL} ${LIBRARY_PATH_BORINGSSL_CRYPTO} dl + z ) set(DISABLE_JEMALLOC ON)