From f01add8c3461d51816e8b28fb75db29578174f51 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Tue, 14 Sep 2021 13:48:58 +0000 Subject: [PATCH] crimson/os: allow to build crimson when WITH_BLUESTORE=OFF. This lets to ensure nobody is accidentally linking with the alienized version of `common`. Signed-off-by: Radoslaw Zarzynski --- src/crimson/os/CMakeLists.txt | 3 ++- src/crimson/os/futurized_store.cc | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/crimson/os/CMakeLists.txt b/src/crimson/os/CMakeLists.txt index f221dd7c131..5054cabf473 100644 --- a/src/crimson/os/CMakeLists.txt +++ b/src/crimson/os/CMakeLists.txt @@ -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) diff --git a/src/crimson/os/futurized_store.cc b/src/crimson/os/futurized_store.cc index ede82c0ac39..0c95676ebc5 100644 --- a/src/crimson/os/futurized_store.cc +++ b/src/crimson/os/futurized_store.cc @@ -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( type, data, values); +#else + ceph_abort_msgf("unsupported objectstore type: %s", type.c_str()); + return {}; +#endif } }