From 7ce914482c6eb28ccf0f59a5464f09fcb0235cc6 Mon Sep 17 00:00:00 2001 From: Isaac Garzon Date: Sun, 31 Jul 2022 13:17:05 +0300 Subject: [PATCH] build: always add the Speedb plugin to the build (#87) This allows us to make sure that our additions are included in the build even if the user forgot to set `ROCKSDB_PLUGINS` explicitly. --- CMakeLists.txt | 11 ++++++++--- Makefile | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fabb83894..b4ec4794c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -959,12 +959,17 @@ list(APPEND SOURCES utilities/transactions/lock/range/range_tree/lib/util/dbt.cc utilities/transactions/lock/range/range_tree/lib/util/memarena.cc) +if (ROCKSDB_PLUGINS) + separate_arguments(ROCKSDB_PLUGINS) +endif() +if (NOT ROCKSDB_PLUGINS OR NOT "speedb" IN_LIST ROCKSDB_PLUGINS) + list(APPEND ROCKSDB_PLUGINS speedb) +endif() set(ROCKSDB_PLUGIN_EXTERNS "") set(ROCKSDB_PLUGIN_BUILTINS "") message(STATUS "ROCKSDB_PLUGINS: ${ROCKSDB_PLUGINS}") -if ( ROCKSDB_PLUGINS ) - string(REPLACE " " ";" PLUGINS ${ROCKSDB_PLUGINS}) - foreach (plugin ${PLUGINS}) +if( ROCKSDB_PLUGINS ) + foreach (plugin ${ROCKSDB_PLUGINS}) set(plugin_root "plugin/${plugin}/") add_subdirectory(${plugin_root}) # Use get_directory_property() to avoid having to declare the variables diff --git a/Makefile b/Makefile index a442c9ce45..d3d5c107ee 100644 --- a/Makefile +++ b/Makefile @@ -242,6 +242,10 @@ am__v_AR_1 = AM_LINK = $(AM_V_CCLD)$(CXX) -L. $(patsubst lib%.a, -l%, $(patsubst lib%.$(PLATFORM_SHARED_EXT), -l%, $^)) $(EXEC_LDFLAGS) -o $@ $(LDFLAGS) $(COVERAGEFLAGS) AM_SHARE = $(AM_V_CCLD) $(CXX) $(PLATFORM_SHARED_LDFLAGS)$@ -L. $(patsubst lib%.$(PLATFORM_SHARED_EXT), -l%, $^) $(EXEC_LDFLAGS) $(LDFLAGS) -o $@ +ifeq ($(strip $(filter speedb,$(ROCKSDB_PLUGINS))),) +ROCKSDB_PLUGINS += speedb +endif + ROCKSDB_PLUGIN_MKS = $(foreach plugin, $(ROCKSDB_PLUGINS), plugin/$(plugin)/*.mk) include $(ROCKSDB_PLUGIN_MKS) ROCKSDB_PLUGIN_PROTO =ROCKSDB_NAMESPACE::ObjectLibrary\&, const std::string\&