diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
commit | 06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /tpool/CMakeLists.txt | |
parent | Initial commit. (diff) | |
download | mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tpool/CMakeLists.txt')
-rw-r--r-- | tpool/CMakeLists.txt | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tpool/CMakeLists.txt b/tpool/CMakeLists.txt new file mode 100644 index 00000000..115e3d58 --- /dev/null +++ b/tpool/CMakeLists.txt @@ -0,0 +1,56 @@ +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include) +IF(WIN32) + SET(EXTRA_SOURCES tpool_win.cc aio_win.cc) +ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + OPTION(WITH_URING "Require that io_uring be used" OFF) + OPTION(WITH_LIBAIO "Require that libaio is used, unless uring is there" OFF) + IF(WITH_URING) + SET(URING_REQUIRED REQUIRED) + ELSEIF(WITH_LIBAIO) + SET(LIBAIO_REQIRED REQUIRED) + ENDIF() + FIND_PACKAGE(URING QUIET ${URING_REQUIRED}) + IF(URING_FOUND) + SET(URING_FOUND ${URING_FOUND} PARENT_SCOPE) + SET(TPOOL_DEFINES "-DHAVE_URING" PARENT_SCOPE) + ADD_DEFINITIONS(-DHAVE_URING) + LINK_LIBRARIES(${URING_LIBRARIES}) + INCLUDE_DIRECTORIES(${URING_INCLUDE_DIRS}) + SET(EXTRA_SOURCES aio_liburing.cc) + SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + SET(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + SET(CMAKE_REQUIRED_INCLUDES ${URING_INCLUDE_DIRS}) + SET(CMAKE_REQUIRED_LIBRARIES ${URING_LIBRARIES}) + CHECK_SYMBOL_EXISTS(io_uring_mlock_size "liburing.h" HAVE_IO_URING_MLOCK_SIZE) + SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + IF(HAVE_IO_URING_MLOCK_SIZE) + SET_SOURCE_FILES_PROPERTIES(aio_liburing.cc PROPERTIES COMPILE_FLAGS "-DHAVE_IO_URING_MLOCK_SIZE") + ENDIF() + ELSE() + FIND_PACKAGE(LIBAIO QUIET ${LIBAIO_REQUIRED}) + IF(LIBAIO_FOUND) + SET(TPOOL_DEFINES "-DLINUX_NATIVE_AIO" PARENT_SCOPE) + ADD_DEFINITIONS(-DLINUX_NATIVE_AIO) + INCLUDE_DIRECTORIES(${LIBAIO_INCLUDE_DIRS}) + LINK_LIBRARIES(${LIBAIO_LIBRARIES}) + SET(EXTRA_SOURCES aio_linux.cc) + ENDIF() + ENDIF() +ENDIF() + +ADD_LIBRARY(tpool STATIC + aio_simulated.cc + tpool_structs.h + CMakeLists.txt + tpool.h + tpool_generic.cc + task_group.cc + task.cc + wait_notification.cc + ${EXTRA_SOURCES} +) + +IF(URING_FOUND) + ADD_DEPENDENCIES(tpool GenError) +ENDIF() |