]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: complain if spdk/pmem is enabled w/o bluestore
authorKefu Chai <kchai@redhat.com>
Mon, 20 Nov 2017 04:55:54 +0000 (12:55 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 20 Nov 2017 05:04:07 +0000 (13:04 +0800)
and complain if bluestore is enabled w/o any backend found.

Signed-off-by: Kefu Chai <kchai@redhat.com>
CMakeLists.txt

index 88705940f24a626393d53774bf05b7a6e995b432..36e97bf6da5a7ff93917ea542c701d5baa7da357 100644 (file)
@@ -185,12 +185,6 @@ else()
   message(STATUS "Not using BLKID")
 endif(LINUX)
 
-option(WITH_BLUESTORE "Bluestore OSD backend" ON)
-if(WITH_BLUESTORE)
-  find_package(aio)
-  set(HAVE_LIBAIO ${AIO_FOUND})
-endif()
-
 option(WITH_OPENLDAP "OPENLDAP is here" ON)
 if(WITH_OPENLDAP)
   find_package(OpenLdap REQUIRED)
@@ -215,20 +209,40 @@ if(WITH_ZFS)
   set(HAVE_LIBZFS ${ZFS_FOUND})
 endif()
 
+option(WITH_BLUESTORE "Bluestore OSD backend" ON)
+if(WITH_BLUESTORE)
+  find_package(aio)
+  set(HAVE_LIBAIO ${AIO_FOUND})
+endif()
+
 if(CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i686|amd64|x86_64|AMD64")
   option(WITH_SPDK "Enable SPDK" ON)
 else()
   option(WITH_SPDK "Enable SPDK" OFF)
 endif()
 if(WITH_SPDK)
+  if(NOT WITH_BLUESTORE)
+    message(SEND_ERROR "Please enable WITH_BLUESTORE for using SPDK")
+  endif()
   include(BuildSPDK)
   build_spdk()
   set(HAVE_SPDK TRUE)
 endif(WITH_SPDK)
 
 option(WITH_PMEM "Enable PMEM" OFF)
-if (WITH_PMEM)
+if(WITH_PMEM)
   set(HAVE_PMEM ON)
+  if(NOT WITH_BLUESTORE)
+    message(SEND_ERROR "Please enable WITH_BLUESTORE for using PMEM")
+  endif()
+endif()
+
+if(WITH_BLUESTORE)
+  if(NOT AIO_FOUND AND NOT WITH_SPDK AND NOT WITH_PMEM)
+    message(SEND_ERROR "WITH_BLUESTORE is ON, "
+      "but none of the bluestore backends is enabled. "
+      "Please install libaio, or enable WITH_SPDK or WITH_PMEM (experimental)")
+  endif()
 endif()
 
 option(WITH_BLUEFS "libbluefs library" OFF)