mirror of
https://github.com/logos-storage/logos-storage-go-bindings-example.git
synced 2026-01-31 11:43:08 +00:00
Debug
This commit is contained in:
parent
3633146b09
commit
703180f835
12
Makefile
12
Makefile
@ -28,24 +28,24 @@ all: run
|
||||
|
||||
fetch:
|
||||
@echo "Fetching libcodex from GitHub Actions: ${LATEST_URL}"
|
||||
@curl -fSL --create-dirs -o $(LIBS_DIR)/codex-${OS}-${ARCH}.zip ${LATEST_URL}
|
||||
curl -fSL --create-dirs -o $(LIBS_DIR)/codex-${OS}-${ARCH}.zip ${LATEST_URL}
|
||||
unzip -o -qq $(LIBS_DIR)/codex-${OS}-${ARCH}.zip -d $(LIBS_DIR)
|
||||
rm -f $(LIBS_DIR)/*.zip
|
||||
# Update the path to the shared library on macOS
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
install_name_tool -id @rpath/libcodex.dylib $(LIBS_DIR)/libcodex.dylib
|
||||
endif
|
||||
|
||||
build:
|
||||
@echo "CGO_CFLAGS=$(CGO_CFLAGS)"
|
||||
@echo "CGO_LDFLAGS=$(CGO_LDFLAGS)"
|
||||
ls -l $(LIBS_DIR)
|
||||
go env CGO_LDFLAGS
|
||||
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN_NAME) main.go
|
||||
|
||||
run:
|
||||
ifeq ($(OS),Windows_NT)
|
||||
pwsh -Command "Copy-Item libs\libcodex.dll ."
|
||||
pwsh -Command ".\$(BIN_NAME)"
|
||||
else ifeq ($(UNAME_S),Darwin)
|
||||
# DYLD_LIBRARY_PATH=$(LIBS_DIR) ./$(BIN_NAME)
|
||||
# Instead of relying on install_name_tool, we can define DYLD_LIBRARY_PATH
|
||||
# DYLD_LIBRARY_PATH=$(LIBS_DIR) ./$(BIN_NAME)
|
||||
./$(BIN_NAME)
|
||||
else
|
||||
./$(BIN_NAME)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user