]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: set HAVE_LIBZBD before creating "acconfig.h" 37788/head
authorKefu Chai <kchai@redhat.com>
Thu, 29 Oct 2020 03:17:32 +0000 (11:17 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 29 Oct 2020 03:19:40 +0000 (11:19 +0800)
`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>
CMakeLists.txt
src/blk/CMakeLists.txt

index c8065e54f2279a34ac9b45501380e79dc5bb0e08..d5dc2b96b28bd0247d49b482e39faede0178d9d9 100644 (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)
index bbbe62ff1337f61f04a13ad05779485d98c5abc6..63be2ecfcf626da64e4f05fc171cdc8f3d0cfd78 100644 (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()