mirror of
https://github.com/logos-storage/logos-storage-go-bindings-example.git
synced 2026-01-03 22:13:07 +00:00
debug
This commit is contained in:
parent
5b26d4e832
commit
6e52a7106d
12
Makefile
12
Makefile
@ -4,8 +4,13 @@ LIBS_DIR := $(abspath ./libs)
|
|||||||
UNAME_S := $(shell uname -s)
|
UNAME_S := $(shell uname -s)
|
||||||
|
|
||||||
# Flags for CGO to find the headers and the shared library
|
# Flags for CGO to find the headers and the shared library
|
||||||
CGO_CFLAGS := -I$(LIBS_DIR)
|
ifeq ($(UNAME_S),Darwin)
|
||||||
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR)
|
CGO_CFLAGS := -I$(LIBS_DIR)
|
||||||
|
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path/./libs
|
||||||
|
else
|
||||||
|
CGO_CFLAGS := -I$(LIBS_DIR)
|
||||||
|
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
BIN_NAME := example.exe
|
BIN_NAME := example.exe
|
||||||
@ -29,6 +34,9 @@ fetch:
|
|||||||
rm -f $(LIBS_DIR)/*.zip
|
rm -f $(LIBS_DIR)/*.zip
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
@echo "CGO_CFLAGS=$(CGO_CFLAGS)"
|
||||||
|
@echo "CGO_LDFLAGS=$(CGO_LDFLAGS)"
|
||||||
|
ls -l $(LIBS_DIR)
|
||||||
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN_NAME) main.go
|
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN_NAME) main.go
|
||||||
|
|
||||||
run:
|
run:
|
||||||
|
|||||||
2
main.go
2
main.go
@ -8,8 +8,6 @@ import (
|
|||||||
"github.com/codex-storage/codex-go-bindings/codex"
|
"github.com/codex-storage/codex-go-bindings/codex"
|
||||||
)
|
)
|
||||||
|
|
||||||
// #cgo LDFLAGS: -L${SRCDIR}/libs -llibcodex
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
node, err := codex.New(codex.Config{
|
node, err := codex.New(codex.Config{
|
||||||
BlockRetries: 5,
|
BlockRetries: 5,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user