Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DB_BACKEND configuration #136

Merged
merged 2 commits into from
Apr 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,26 @@ endif

# DB backend selection
ifeq (,$(filter $(LBM_BUILD_OPTIONS), cleveldb rocksdb boltdb badgerdb))
BUILD_TAGS += goleveldb
BUILD_TAGS += goleveldb
DB_BACKEND = goleveldb
else
ifeq (cleveldb,$(findstring cleveldb,$(LBM_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_TAGS += gcc cleveldb
ldflags += -X github.com/line/lbm-sdk/v2/types.DBBackend=cleveldb
DB_BACKEND = cleveldb
endif
ifeq (badgerdb,$(findstring badgerdb,$(LBM_BUILD_OPTIONS)))
BUILD_TAGS += badgerdb
ldflags += -X github.com/line/lbm-sdk/v2/types.DBBackend=badgerdb
DB_BACKEND = badgerdb
endif
ifeq (rocksdb,$(findstring rocksdb,$(LBM_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_TAGS += rocksdb
ldflags += -X github.com/line/lbm-sdk/v2/types.DBBackend=rocksdb
BUILD_TAGS += gcc rocksdb
DB_BACKEND = rocksdb
endif
ifeq (boltdb,$(findstring boltdb,$(LBM_BUILD_OPTIONS)))
BUILD_TAGS += boltdb
ldflags += -X github.com/line/lbm-sdk/v2/types.DBBackend=boltdb
DB_BACKEND = boltdb
endif
endif

Expand All @@ -78,6 +80,7 @@ ldflags = -X github.com/line/lbm-sdk/v2/version.Name=sim \
-X github.com/line/lbm-sdk/v2/version.AppName=simd \
-X github.com/line/lbm-sdk/v2/version.Version=$(VERSION) \
-X github.com/line/lbm-sdk/v2/version.Commit=$(COMMIT) \
-X github.com/line/lbm-sdk/v2/types.DBBackend=$(DB_BACKEND) \
-X "github.com/line/lbm-sdk/v2/version.BuildTags=$(build_tags_comma_sep)"

ifeq (,$(findstring nostrip,$(LBM_BUILD_OPTIONS)))
Expand Down