mistserver/scripts/webrtc_srtp_cmakelists.txt
2021-10-19 22:29:39 +02:00

112 lines
3.5 KiB
Text

cmake_minimum_required(VERSION 3.8)
project(srtp2)
set(bd ${CMAKE_CURRENT_LIST_DIR})
set(sd ${bd})
list(APPEND lib_sources
${sd}/srtp/srtp.c
${sd}/srtp/ekt.c
${sd}/crypto/kernel/alloc.c
${sd}/crypto/kernel/err.c
${sd}/crypto/kernel/crypto_kernel.c
${sd}/crypto/kernel/key.c
${sd}/crypto/math/datatypes.c
${sd}/crypto/math/stat.c
${sd}/crypto/replay/rdbx.c
${sd}/crypto/replay/rdb.c
${sd}/crypto/replay/ut_sim.c
${sd}/crypto/cipher/cipher.c
${sd}/crypto/cipher/null_cipher.c
${sd}/crypto/cipher/aes.c
${sd}/crypto/hash/auth.c
${sd}/crypto/hash/null_auth.c
${sd}/crypto/cipher/aes_icm.c
${sd}/crypto/hash/sha1.c
${sd}/crypto/hash/hmac.c
)
# -- start of checks
include(CheckIncludeFiles)
include(CheckFunctionExists)
include(CheckLibraryExists)
include(CheckTypeSize)
include(TestBigEndian)
set(AC_APPLE_UNIVERSAL_BUILD 0)
set(CPU_CISC 1)
set(CPU_RISC 0)
set(ENABLE_DEBUG_LOGGING 0)
set(ERR_REPORTING_FILE "libsrtp_error.log")
set(ERR_REPORTING_STDOUT 0)
set(VERSION "2.3")
check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
check_include_files(byteswap.h HAVE_BYTESWAP_H)
check_function_exists(inet_aton HAVE_INET_ATON)
check_type_size(int16_t HAVE_INT16_T)
check_type_size(int32_t HAVE_INT32_T)
check_type_size(int8_t HAVE_INT8_T)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_library_exists(dl dlopen "" HAVE_LIBDL)
check_library_exists(socket socket "" HAVE_LIBSOCKET)
check_library_exists(z zlibVersion "" HAVE_LIBZ)
check_include_files(machine/types.h HAVE_MACHINE_TYPES_H)
check_include_files(memory.h HAVE_MEMORY_H)
check_include_files(netinet/in.h HAVE_NETINET_IN_H)
# @todo check winpcap
check_function_exists(sigaction HAVE_SIGACTION)
check_function_exists(socket HAVE_SOCKET)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(string.h HAVE_STRING_H)
check_include_files(sys/int_types.h HAVE_SYS_INT_TYPES_H)
check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(sys/uio.h HAVE_SYS_UIO_H)
check_type_size(uint16_t HAVE_UINT16_T)
check_type_size(uint32_t HAVE_UINT32_T)
check_type_size(uint64_t HAVE_UINT64_T)
check_type_size(uint8_t HAVE_UINT8_T)
check_include_files(unistd.h HAVE_UNISTD_H)
check_function_exists(usleep HAVE_USLEEP)
check_include_files(windows.h HAVE_WINDOWS_H)
check_include_files(winsock2.h HAVE_WINSOCK2_H)
# @todo HAVE_X86
# @todo OPENSSL
# @todo OPENSSL_CLEANSE_BROKEN
# @todo OPENSSL_KDF
# @todo PACKAGE_BUGREPORT
set(PACKAGE_BUGREPORT "testers@ddvdtech.com")
set(PACKAGE_NAME "libsrtp")
set(PACKAGE_VERSION "${VERSION}")
set(PACKAGE_STRING "${PACKAGE_NAME}_${VERSION}")
set(PACKAGE_TARNAME "${PACKAGE_STRING}.tar")
set(PACKAGE_URL "http://www.mistserver.org")
check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)
check_type_size("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG)
check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
configure_file(${bd}/config.cmake ${bd}/crypto/include/config.h)
#--------------------------------------------------------
include_directories(
${bd}/include/
${bd}/crypto/
${bd}/crypto/include
)
add_library(srtp2 STATIC ${lib_sources})
target_compile_definitions(srtp2 PUBLIC HAVE_CONFIG_H)
list(APPEND include_files
${bd}/include/srtp.h
${bd}/crypto/include/cipher.h
${bd}/crypto/include/auth.h
${bd}/crypto/include/crypto_types.h
)
install(FILES ${include_files} DESTINATION include)
install(TARGETS srtp2 ARCHIVE DESTINATION lib)