Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Io uring #249

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ if(HAVE_RECVMMSG_API)
add_definitions(-DHAVE_RECVMMSG_API)
endif()


# check the socket buffer size set by the upper cmake project, if it is set, use the setting of the upper cmake project, otherwise set it to 256K
# if the socket buffer size is set to 0, it means that the socket buffer size is not set, and the kernel default value is used(just for linux)
if(DEFINED SOCKET_DEFAULT_BUF_SIZE)
Expand Down Expand Up @@ -88,6 +89,19 @@ endif()
set(ENABLE_OPENSSL ON CACHE BOOL "enable openssl")
set(ENABLE_MYSQL ON CACHE BOOL "enable mysql")
set(ASAN_USE_DELETE OFF CACHE BOOL "use delele[] or free when asan enabled")
set(ENABLE_IO_URING OFF CACHE BOOL "enable io_uring")

# 添加io_uring支持
# Add io_uring support
if(ENABLE_IO_URING)
find_package(LIBURING QUIET)
if(LIBURING_FOUND)
message(STATUS "Found liburing")
add_definitions(-DHAS_IO_URING)
include_directories(${LIBURING_INCLUDE_DIRS})
list(APPEND LINK_LIB_LIST ${LIBURING_LIBRARIES})
endif()
endif()

#查找openssl是否安装
#Find out if openssl is installed
Expand Down
16 changes: 16 additions & 0 deletions cmake/FindLIBURING.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

find_path(LIBURING_INCLUDE_DIR NAMES liburing.h)
mark_as_advanced(LIBURING_INCLUDE_DIR)

find_library(LIBURING_LIBRARY NAMES uring)
mark_as_advanced(LIBURING_LIBRARY)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
LIBURING
REQUIRED_VARS LIBURING_LIBRARY LIBURING_INCLUDE_DIR)

if(LIBURING_FOUND)
set(LIBURING_LIBRARIES ${LIBURING_LIBRARY})
set(LIBURING_INCLUDE_DIRS ${LIBURING_INCLUDE_DIR})
endif()
Loading
Loading