From b1e133468f36fe7680d4967220ca42478ddf8c7f Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 29 Oct 2020 11:17:32 +0800 Subject: [PATCH] cmake: set HAVE_LIBZBD before creating "acconfig.h" `acconfig.h` is generated using configure_file( ${CMAKE_SOURCE_DIR}/src/include/config-h.in.cmake ${CMAKE_BINARY_DIR}/include/acconfig.h ) in `config-h.in.cmake`, the cmake variable of `HAVE_LIBZBD` is checked. so we need to ensure that this variable is visible from this `configure_file()` statement. Signed-off-by: Kefu Chai --- CMakeLists.txt | 4 ++++ src/blk/CMakeLists.txt | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8065e54f22..d5dc2b96b28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,6 +196,10 @@ include(CMakeDependentOption) CMAKE_DEPENDENT_OPTION(WITH_ZBD "Enable libzbd bluestore backend" OFF "WITH_BLUESTORE" OFF) +if(WITH_ZBD) + find_package(zbd) + set(HAVE_LIBZBD ${ZBD_FOUND}) +endif() CMAKE_DEPENDENT_OPTION(WITH_LIBURING "Enable io_uring bluestore backend" OFF "WITH_BLUESTORE;HAVE_LIBAIO" OFF) diff --git a/src/blk/CMakeLists.txt b/src/blk/CMakeLists.txt index bbbe62ff133..63be2ecfcf6 100644 --- a/src/blk/CMakeLists.txt +++ b/src/blk/CMakeLists.txt @@ -21,8 +21,6 @@ if(WITH_SPDK) endif() if(WITH_ZBD) - find_package(zbd REQUIRED) - set(HAVE_LIBZBD ${ZBD_FOUND}) list(APPEND libblk_srcs zoned/HMSMRDevice.cc) endif()