From cbe72db7be79c6837039f2e0d7f714f13f6e6a4c Mon Sep 17 00:00:00 2001 From: Marko Date: Tue, 15 Sep 2020 10:27:14 +0200 Subject: [PATCH] makefile: add options for other DBs (#5357) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This PR adds support for badgerdb, rocksdb and boltdb within the build options. RocksDB builds correctly. ``` make build TENDERMINT_BUILD_OPTIONS=rocksdb CGO_ENABLED=1 go build -mod=readonly -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD` -s -w " -trimpath -tags 'tendermint rocksdb' -o build/tendermint ./cmd/tendermint/ tendermint on  master [$!] via 🐹 v1.15.2 took 19s ``` Closes: #5355 --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 46abb868a..27fe22aac 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,22 @@ ifeq (cleveldb,$(findstring cleveldb,$(TENDERMINT_BUILD_OPTIONS))) BUILD_TAGS += cleveldb endif +# handle badgerdb +ifeq (badgerdb,$(findstring badgerdb,$(TENDERMINT_BUILD_OPTIONS))) + BUILD_TAGS += badgerdb +endif + +# handle rocksdb +ifeq (rocksdb,$(findstring rocksdb,$(TENDERMINT_BUILD_OPTIONS))) + CGO_ENABLED=1 + BUILD_TAGS += rocksdb +endif + +# handle boltdb +ifeq (boltdb,$(findstring boltdb,$(TENDERMINT_BUILD_OPTIONS))) + BUILD_TAGS += boltdb +endif + # allow users to pass additional flags via the conventional LDFLAGS variable LD_FLAGS += $(LDFLAGS)