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 <rzarzyns@redhat.com>
This commit is contained in:
Radoslaw Zarzynski 2021-09-14 13:48:58 +00:00
parent 569368a2fc
commit f01add8c34
2 changed files with 9 additions and 1 deletions

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

View 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
}
}