diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:04:16 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:04:16 +0000 |
commit | a68fb2d8219f6bccc573009600e9f23e89226a5e (patch) | |
tree | d742d35d14ae816e99293d2b01face30e9f3a46b /tpool/CMakeLists.txt | |
parent | Initial commit. (diff) | |
download | mariadb-10.6-a68fb2d8219f6bccc573009600e9f23e89226a5e.tar.xz mariadb-10.6-a68fb2d8219f6bccc573009600e9f23e89226a5e.zip |
Adding upstream version 1:10.6.11.upstream/1%10.6.11upstream
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..3a49ea22 --- /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_DIR}) + 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_DIR}) + 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_DIR}) + 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() |