2026-07-17 08:21:19 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
# Copyright (c) 2024-2026 Quad4.io
|
|
|
|
|
#
|
2026-07-19 11:01:13 -05:00
|
|
|
# Build librns and run C++ bindings tests plus examples.
|
2026-07-17 08:21:19 -05:00
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
2026-07-17 08:30:32 -05:00
|
|
|
ROOT="$(CDPATH='' cd -- "$(dirname "$0")/../.." && pwd)"
|
2026-07-17 08:21:19 -05:00
|
|
|
cd "$ROOT"
|
|
|
|
|
|
|
|
|
|
if ! command -v cmake >/dev/null 2>&1; then
|
|
|
|
|
echo "cmake not found on PATH" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if ! command -v c++ >/dev/null 2>&1 && ! command -v g++ >/dev/null 2>&1; then
|
|
|
|
|
echo "C++ compiler not found on PATH" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if command -v task >/dev/null 2>&1; then
|
|
|
|
|
task build-librns
|
|
|
|
|
else
|
|
|
|
|
mkdir -p bin
|
|
|
|
|
CGO_ENABLED=1 go build -buildmode=c-shared -o bin/librns.so ./cmd/librns
|
|
|
|
|
cp include/rns.h bin/rns.h
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
make -C bindings/cpp test
|
2026-07-19 11:01:13 -05:00
|
|
|
make -C bindings/cpp examples
|