File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,13 @@ LIBS_DIR := $(abspath ./libs)
44UNAME_S := $(shell uname -s)
55
66# Flags for CGO to find the headers and the shared library
7- CGO_CFLAGS := -I$(LIBS_DIR )
8- CGO_LDFLAGS := -L$(LIBS_DIR ) -lcodex -Wl,-rpath,$(LIBS_DIR )
7+ ifeq ($(UNAME_S ) ,Darwin)
8+ CGO_CFLAGS := -I$(LIBS_DIR)
9+ CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path/./libs
10+ else
11+ CGO_CFLAGS := -I$(LIBS_DIR)
12+ CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR)
13+ endif
914
1015ifeq ($(OS ) ,Windows_NT)
1116 BIN_NAME := example.exe
2934 rm -f $(LIBS_DIR ) /* .zip
3035
3136build :
37+ @echo "CGO_CFLAGS=$(CGO_CFLAGS)"
38+ @echo "CGO_LDFLAGS=$(CGO_LDFLAGS)"
39+ ls -l $(LIBS_DIR)
3240 CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN_NAME) main.go
3341
3442run :
Original file line number Diff line number Diff line change 88 "github.com/codex-storage/codex-go-bindings/codex"
99)
1010
11- // #cgo LDFLAGS: -L${SRCDIR}/libs -llibcodex
12-
1311func main () {
1412 node , err := codex .New (codex.Config {
1513 BlockRetries : 5 ,
You can’t perform that action at this time.
0 commit comments