mirror of
https://github.com/logos-storage/logos-storage-go-bindings.git
synced 2026-01-05 23:13:09 +00:00
Use CGO_CFLAGS and CGO_LDFLAGS to build
This commit is contained in:
parent
e3000cfad4
commit
e9af423861
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -46,9 +46,9 @@ jobs:
|
||||
- name: Build codex go
|
||||
run: |
|
||||
cd codex
|
||||
go build -o codex-go
|
||||
make
|
||||
|
||||
- name: Go test
|
||||
env:
|
||||
CGO_ENABLED: 1
|
||||
run: go test ./...
|
||||
run: make test
|
||||
|
||||
7
.vscode/settings.json
vendored
Normal file
7
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"go.toolsEnvVars": {
|
||||
"CGO_CFLAGS": "-I${workspaceFolder}/vendor/nim-codex/library",
|
||||
"CGO_LDFLAGS": "-L${workspaceFolder}/vendor/nim-codex/build -Wl,-rpath,${workspaceFolder}/vendor/nim-codex/build",
|
||||
"LD_LIBRARY_PATH": "${workspaceFolder}/vendor/nim-codex/build:${env:LD_LIBRARY_PATH}"
|
||||
}
|
||||
}
|
||||
13
Makefile
13
Makefile
@ -1,8 +1,13 @@
|
||||
# Makefile for Codex Go Bindings
|
||||
|
||||
NIM_CODEX_DIR := vendor/nim-codex
|
||||
NIM_CODEX_LIB_DIR := $(abspath $(NIM_CODEX_DIR)/library)
|
||||
NIM_CODEX_BUILD_DIR := $(abspath $(NIM_CODEX_DIR)/build)
|
||||
|
||||
.PHONY: all clean update build-libcodex build
|
||||
CGO_CFLAGS := -I$(NIM_CODEX_LIB_DIR)
|
||||
CGO_LDFLAGS := -L$(NIM_CODEX_BUILD_DIR) -Wl,-rpath,$(NIM_CODEX_BUILD_DIR)
|
||||
|
||||
.PHONY: all clean update libcodex build test
|
||||
|
||||
all: build
|
||||
|
||||
@ -20,7 +25,11 @@ libcodex:
|
||||
|
||||
build:
|
||||
@echo "Building Codex Go Bindings..."
|
||||
go build -o codex-go codex
|
||||
CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o codex-go ./codex
|
||||
|
||||
test:
|
||||
@echo "Running tests..."
|
||||
CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go test ./...
|
||||
|
||||
clean:
|
||||
@echo "Cleaning up..."
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "../vendor/nim-codex/library/libcodex.h"
|
||||
#include "libcodex.h"
|
||||
|
||||
extern void callback(int ret, char* msg, size_t len, void* resp);
|
||||
Loading…
x
Reference in New Issue
Block a user