mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
检查sendmmsg相关依赖并设置对应的宏
This commit is contained in:
parent
b0f0bdb6ae
commit
d78657b706
@ -1,5 +1,23 @@
|
||||
project(ZLMediaKit)
|
||||
cmake_minimum_required(VERSION 3.1.3)
|
||||
include(CheckStructHasMember)
|
||||
include(CheckSymbolExists)
|
||||
|
||||
# 检查sendmmsg相关依赖并设置对应的宏
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
|
||||
check_struct_has_member("struct mmsghdr" msg_hdr sys/socket.h HAVE_MMSG_HDR)
|
||||
check_symbol_exists(sendmmsg sys/socket.h HAVE_SENDMMSG_API)
|
||||
check_symbol_exists(recvmmsg sys/socket.h HAVE_RECVMMSG_API)
|
||||
|
||||
if(HAVE_MMSG_HDR)
|
||||
add_definitions(-DHAVE_MMSG_HDR)
|
||||
endif()
|
||||
if(HAVE_SENDMMSG_API)
|
||||
add_definitions(-DHAVE_SENDMMSG_API)
|
||||
endif()
|
||||
if(HAVE_RECVMMSG_API)
|
||||
add_definitions(-DHAVE_RECVMMSG_API)
|
||||
endif()
|
||||
#使能c++11
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
#加载自定义模块
|
||||
|
Loading…
Reference in New Issue
Block a user