Skip to content

Commit 6e52a71

Browse files
committed
debug
1 parent 5b26d4e commit 6e52a71

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ LIBS_DIR := $(abspath ./libs)
44
UNAME_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

1015
ifeq ($(OS),Windows_NT)
1116
BIN_NAME := example.exe
@@ -29,6 +34,9 @@ fetch:
2934
rm -f $(LIBS_DIR)/*.zip
3035

3136
build:
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

3442
run:

main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import (
88
"github.com/codex-storage/codex-go-bindings/codex"
99
)
1010

11-
// #cgo LDFLAGS: -L${SRCDIR}/libs -llibcodex
12-
1311
func main() {
1412
node, err := codex.New(codex.Config{
1513
BlockRetries: 5,

0 commit comments

Comments
 (0)