Skip to content

Commit

Permalink
Fix rocksdb flags to work on darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
aalda authored and gdiazlo committed Mar 14, 2019
1 parent 505004b commit b627664
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions c-deps/builddeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e

BASE=$(pwd)
LIBS="$BASE/libs"
mkdir -p $LIBS

# build jemalloc
if [ ! -f $LIBS/libjemalloc.so.2 ]; then
Expand Down
10 changes: 6 additions & 4 deletions rocksdb/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

package rocksdb

// #cgo CFLAGS: -I${SRCDIR}/../c-deps/rocksdb/include/
// #cgo CFLAGS: -I${SRCDIR}/../c-deps/rocksdb/include
// #cgo LDFLAGS: -L${SRCDIR}/../c-deps/libs
// #cgo LDFLAGS: ${SRCDIR}/../c-deps/libs/librocksdb.a
// #cgo LDFLAGS: ${SRCDIR}/../c-deps/libs/libjemalloc.a
// #cgo LDFLAGS: ${SRCDIR}/../c-deps/libs/libsnappy.a
// #cgo LDFLAGS: -lrocksdb
// #cgo LDFLAGS: -ljemalloc
// #cgo LDFLAGS: -lsnappy
// #cgo LDFLAGS: -lstdc++
// #cgo LDFLAGS: -ldl
// #cgo LDFLAGS: -lm
// #cgo darwin LDFLAGS: -Wl,-undefined -Wl,dynamic_lookup
// #cgo !darwin LDFLAGS: -Wl,-unresolved_symbols=ignore-all -lrt
import "C"

0 comments on commit b627664

Please sign in to comment.