From 4fbe3df09599cecc6d999ec1ef0afd45c63a610d Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 5 Feb 2022 20:31:11 +0100 Subject: [PATCH] Allow enabling Boost.Asio's support for using `io_uring` It won't likely do much regarding file handling as code is currently still using `boost::asio::posix::stream_descriptor` or Boost.Beast's file handling (which uses blocking I/O). I suppose one needs to use the new file API described here under "Asio 1.22.0 / Boost 1.78": https://www.boost.org/doc/libs/1_78_0/doc/html/boost_asio/history.html --- librepomgr/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/librepomgr/CMakeLists.txt b/librepomgr/CMakeLists.txt index 814b7b7..eca1057 100644 --- a/librepomgr/CMakeLists.txt +++ b/librepomgr/CMakeLists.txt @@ -92,6 +92,11 @@ endif () set(BOOST_ARGS "REQUIRED;COMPONENTS;system;filesystem") use_package(TARGET_NAME Boost::system PACKAGE_NAME Boost PACKAGE_ARGS "${BOOST_ARGS}") use_package(TARGET_NAME Boost::filesystem PACKAGE_NAME Boost PACKAGE_ARGS "${BOOST_ARGS}") +option(BOOST_ASIO_IO_URING OFF "enable use of io_uring") +if (BOOST_ASIO_IO_URING) + list(APPEND META_PUBLIC_COMPILE_DEFINITIONS BOOST_ASIO_HAS_IO_URING BOOST_ASIO_DISABLE_EPOLL) + use_pkg_config_module(PKG_CONFIG_MODULES "liburing" VISIBILITY PUBLIC) +endif () # find reflective-rapidjson find_package(reflective_rapidjson${CONFIGURATION_PACKAGE_SUFFIX} REQUIRED)