]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os: allow to build crimson when WITH_BLUESTORE=OFF.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 14 Sep 2021 13:48:58 +0000 (13:48 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 14 Sep 2021 15:04:35 +0000 (15:04 +0000)
This lets to ensure nobody is accidentally linking with the alienized
version of `common`.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/os/CMakeLists.txt
src/crimson/os/futurized_store.cc

index f221dd7c131a215053fae1599588c945da5fdaae..5054cabf47372e590277da48eb216ff6ff819c4f 100644 (file)
@@ -5,11 +5,12 @@ add_subdirectory(cyanstore)
 
 if(WITH_BLUESTORE)
   add_subdirectory(alienstore)
+  set(alienstore_lib crimson-alienstore)
 endif()
 
 add_subdirectory(seastore)
 target_link_libraries(crimson-os
   crimson-cyanstore
-  crimson-alienstore
+  ${alienstore_lib}
   crimson-seastore
   crimson)
index ede82c0ac3961973fcb04b310ffb0011244ac46c..0c95676ebc5d0d3f48f1cfdd6ab541eb76e7990b 100644 (file)
@@ -1,6 +1,8 @@
 #include "futurized_store.h"
 #include "cyanstore/cyan_store.h"
+#ifdef WITH_BLUESTORE
 #include "alienstore/alien_store.h"
+#endif
 #include "seastore/seastore.h"
 
 namespace crimson::os {
@@ -15,9 +17,14 @@ FuturizedStore::create(const std::string& type,
   } else if (type == "seastore") {
     return crimson::os::seastore::make_seastore(data, values);
   } else {
+#ifdef WITH_BLUESTORE
     // use AlienStore as a fallback. It adapts e.g. BlueStore.
     return std::make_unique<crimson::os::AlienStore>(
       type, data, values);
+#else
+    ceph_abort_msgf("unsupported objectstore type: %s", type.c_str());
+    return {};
+#endif
   }
 }