pass the include and lib based on NIM_SDS_REPO_PATH env var

This commit is contained in:
Ivan Folgueira Bande 2025-10-20 23:29:00 +02:00
parent 20404c85a0
commit b501442965
No known key found for this signature in database
GPG Key ID: 3C117481F89E24A7
2 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,10 @@
# Makefile for SDS Go Bindings # Makefile for SDS Go Bindings
# The NIM_SDS_REPO_PATH env var should be defined beforehand and it represents the absolute path
# to the cloned nim-sds repository, i.e, ....../third_party/nim-sds
export CGO_CFLAGS="-I${NIM_SDS_REPO_PATH}/library/"
export CGO_LDFLAGS="-L${NIM_SDS_REPO_PATH}/build -lsds -Wl,-rpath,${NIM_SDS_REPO_PATH}/build"
.PHONY: all clean prepare build-libsds build .PHONY: all clean prepare build-libsds build
# Default target # Default target
@ -11,7 +16,7 @@ prepare:
@mkdir -p ../third_party @mkdir -p ../third_party
@if [ ! -d "../third_party/nim-sds" ]; then \ @if [ ! -d "../third_party/nim-sds" ]; then \
@echo "Cloning nim-sds repository..." echo "Cloning nim-sds repository..." ; \
cd ../third_party/ && \ cd ../third_party/ && \
git clone https://github.com/waku-org/nim-sds && \ git clone https://github.com/waku-org/nim-sds && \
cd nim-sds && \ cd nim-sds && \

View File

@ -1,10 +1,7 @@
package sds package sds
/* /*
#cgo LDFLAGS: -L../third_party/nim-sds/build/ -lsds #include <libsds.h>
#cgo LDFLAGS: -L../third_party/nim-sds -Wl,-rpath,../third_party/nim-sds/build/
#include "../third_party/nim-sds/library/libsds.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>