CMakeLists.txt: find aio for CRIMSON or BLUESTORE

aio is used to set WITH_LIBURING, instead of finding it twice try to
find aio if either flags are set.
Does not change existing behavior for Bluestore.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
This commit is contained in:
Matan Breizman 2026-02-02 16:42:39 +02:00
parent 7240a99fe1
commit f95b264aab

View File

@ -245,10 +245,7 @@ endif()
option(WITH_BLUESTORE "Bluestore OSD backend" ON)
if(WITH_BLUESTORE)
if(LINUX)
find_package(aio)
set(HAVE_LIBAIO ${AIO_FOUND})
elseif(FREEBSD)
if(FREEBSD)
# POSIX AIO is integrated into FreeBSD kernel, and exposed by libc.
set(HAVE_POSIXAIO ON)
endif()
@ -256,6 +253,13 @@ endif()
option(WITH_CRIMSON "Build Crimson components" OFF)
if(WITH_BLUESTORE OR WITH_CRIMSON)
if(LINUX)
find_package(aio)
set(HAVE_LIBAIO ${AIO_FOUND})
endif()
endif()
# libcryptsetup is only available on linux
if(WITH_RBD AND LINUX)
find_package(libcryptsetup 2.0.5 REQUIRED)