add android support

This commit is contained in:
Ivan Folgueira Bande 2025-08-25 17:06:04 +02:00
parent 45106c938c
commit 267810e77f
No known key found for this signature in database
GPG Key ID: 3C117481F89E24A7

View File

@ -1,10 +1,5 @@
# Makefile for SDS Go Bindings
# Directories
THIRD_PARTY_DIR := ../third_party
NIM_SDS_REPO := https://github.com/waku-org/nim-sds
NIM_SDS_DIR := $(THIRD_PARTY_DIR)/nim-sds
.PHONY: all clean prepare build-libsds build
# Default target
@ -13,31 +8,34 @@ all: build
# Prepare third_party directory and clone nim-sds
prepare:
@echo "Creating third_party directory..."
@mkdir -p $(THIRD_PARTY_DIR)
@mkdir -p ../third_party
@echo "Cloning nim-sds repository..."
@if [ ! -d "$(NIM_SDS_DIR)" ]; then \
cd $(THIRD_PARTY_DIR) && \
git clone $(NIM_SDS_REPO) && \
cd $(NIM_SDS_DIR) && \
git checkout master; \
make update; \
@if [ ! -d "../third_party/nim-sds" ]; then \
cd ../third_party/ && \
git clone https://github.com/waku-org/nim-sds && \
cd nim-sds && \
git checkout add-android-support; \
make update; \
else \
echo "nim-sds repository already exists."; \
fi
# Build libsds
build-libsds: prepare
# Build SDS Go Bindings
build: prepare
@echo "Building libsds..."
@cd $(NIM_SDS_DIR) && make libsds
@echo "Building SDS Go Bindings..."
go build ./...
# Build SDS Go Bindings
build: build-libsds
build-android: prepare
@echo "Building libsds..."
@cd $(NIM_SDS_DIR) && make libsds-android
@echo "Building SDS Go Bindings..."
go build ./...
# Clean up generated files
clean:
@echo "Cleaning up..."
@rm -rf $(THIRD_PARTY_DIR)
@rm -f sds-go-bindings
@rm -rf ../third_party/
@rm -f sds-go-bindings