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 <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2020-10-29 11:17:32 +08:00
parent 98c06b534f
commit b1e133468f
2 changed files with 4 additions and 2 deletions

View File

@ -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)

View File

@ -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()