Skip to content

Commit

Permalink
build: Add support for linking against a system librocksdb
Browse files Browse the repository at this point in the history
Add a new USE_SYSTEM_ROCKSDB make variable to select whether to link
against the system librocksdb.
  • Loading branch information
guillemj authored and JohnSully committed Mar 26, 2024
1 parent ae130d1 commit d67c658
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ distclean:
ifneq ($(USE_SYSTEM_JEMALLOC),yes)
-(cd jemalloc && [ -f Makefile ] && $(MAKE) distclean) > /dev/null || true
endif
ifneq ($(USE_SYSTEM_ROCKSDB),yes)
-(cd rocksdb && $(MAKE) clean) > /dev/null || true
endif
-(cd hdr_histogram && $(MAKE) clean) > /dev/null || true
-(rm -f .make-*)

Expand Down
11 changes: 9 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,19 @@ ifneq ($(strip $(SANITIZE)),)
endif

ifeq ($(ENABLE_FLASH),yes)
STORAGE_OBJ+= storage/rocksdb.o storage/rocksdbfactory.o
ifeq ($(USE_SYSTEM_ROCKSDB),yes)
FINAL_LIBS+= $(shell pkg-config --libs rocksdb)
FINAL_CXXFLAGS+= $(shell pkg-config --cflags rocksdb) -DENABLE_ROCKSDB

else
FINAL_LIBS+= -lz -lcrypto -lbz2 -lzstd -llz4 -lsnappy
CXXFLAGS+= -I../deps/rocksdb/include/ -DENABLE_ROCKSDB
STORAGE_OBJ+= storage/rocksdb.o storage/rocksdbfactory.o
FINAL_CXXFLAGS+= -I../deps/rocksdb/include/
FINAL_LIBS+= ../deps/rocksdb/librocksdb.a
DEPENDENCY_TARGETS+= rocksdb
endif
endif


ifeq ($(CHECKED),true)
Expand Down Expand Up @@ -268,7 +275,7 @@ endif

# Include paths to dependencies
FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram
FINAL_CXXFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -I../deps/rocksdb/include/
FINAL_CXXFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram

ifeq ($(USE_SYSTEM_CONCURRENTQUEUE),yes)
FINAL_CXXFLAGS+= -I/usr/include/concurrentqueue/moodycamel
Expand Down

0 comments on commit d67c658

Please sign in to comment.