From 388bf718137e0685b90a75c56a37fb3c565cfe84 Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Mon, 25 Jul 2022 23:49:38 +0800 Subject: [PATCH] Fix finding mmsghdr --- 3rdpart/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3rdpart/CMakeLists.txt b/3rdpart/CMakeLists.txt index 5400a1fc..9614ec48 100644 --- a/3rdpart/CMakeLists.txt +++ b/3rdpart/CMakeLists.txt @@ -115,8 +115,8 @@ endif() include(CheckStructHasMember) include(CheckSymbolExists) -# 检查 sendmmsg 相关依赖并设置对应的宏 -#list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) +# 检查 sendmmsg 相关依赖并设置对应的宏, 配置 _GNU_SOURCE 以启用 GNU 扩展特性 +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)