Skip to content

Commit

Permalink
Add grocksdb_no_link build flag to remove builtin link flags (#106)
Browse files Browse the repository at this point in the history
user can have full control through CGO_LDFLAGS environment variable.
  • Loading branch information
yihuang authored Feb 21, 2023
1 parent bb759a8 commit 8ff78a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ libs:

.PHONY: test
test:
go test -v -count=1 -tags testing
go test -v -count=1 -tags testing,grocksdb_no_link
4 changes: 3 additions & 1 deletion non_builtin.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//go:build !testing && !grocksdb_clean_link
//go:build !grocksdb_no_link && !grocksdb_clean_link

// The default link options, to customize it, you can try build tag `grocksdb_clean_link` for a cleaner set of flags,
// or `grocksdb_no_link` where you have full control through `CGO_LDFLAGS` environment variable.
package grocksdb

// #cgo LDFLAGS: -lrocksdb -pthread -lstdc++ -ldl -lm -lzstd -llz4 -lz -lsnappy
Expand Down
2 changes: 1 addition & 1 deletion non_builtin_clean_link.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build !testing && grocksdb_clean_link
//go:build !grocksdb_no_link && grocksdb_clean_link

package grocksdb

Expand Down

0 comments on commit 8ff78a9

Please sign in to comment.