Skip to content

Commit

Permalink
Add procedure to use static libraries when building rocksdb bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
gdiazlo committed Mar 14, 2019
1 parent 5af4c89 commit 692b20d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions c-deps/builddeps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

cd rocksdb
DEBUG_LEVEL=0
PORTABLE=1

for lib in libbz2.a liblz4.a librocksdb.a libsnappy.a libz.a libzstd.a; do
make $lib
done
strip *.a
cd ..


2 changes: 1 addition & 1 deletion rocksdb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package rocksdb

// #cgo LDFLAGS: -L../c-deps/rocksdb/
// #cgo LDFLAGS: -lrocksdb
// #cgo LDFLAGS: -l:librocksdb.a -l:libstdc++.a -l:libz.a -l:libbz2.a -l:libsnappy.a -l:libzstd.a -lm
// #include "../c-deps/rocksdb/include/rocksdb/c.h"
// #include <stdlib.h>
import "C"
Expand Down
2 changes: 1 addition & 1 deletion rocksdb/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package rocksdb

// #cgo LDFLAGS: -L../c-deps/rocksdb/
// #cgo LDFLAGS: -lrocksdb
// #cgo LDFLAGS: -l:librocksdb.a -l:libstdc++.a -l:libz.a -l:libbz2.a -l:libsnappy.a -l:libzstd.a -lm
// #include "../c-deps/rocksdb/include/rocksdb/c.h"
import "C"

Expand Down

0 comments on commit 692b20d

Please sign in to comment.