example: plattformneutral gegen target link; linux delete via POST; build.sh nutzt vcpkg-Toolchain, baut lib+example; tests laufen

This commit is contained in:
2025-08-28 16:15:47 +02:00
parent df74c8a1af
commit 063800df12
3 changed files with 22 additions and 34 deletions

View File

@ -1,15 +1,22 @@
#!/bin/bash
echo "Building PrivateBin API C++ DLL..."
set -euo pipefail
echo "Building PrivateBin API C++ (library + example)"
# Create build directory
mkdir -p build
cd build
# Ensure vcpkg exists
VCPKG_ROOT="${VCPKG_ROOT:-$HOME/vcpkg}"
if [ ! -d "$VCPKG_ROOT" ]; then
echo "vcpkg not found under $VCPKG_ROOT, cloning..."
git clone https://github.com/microsoft/vcpkg.git "$VCPKG_ROOT"
"$VCPKG_ROOT/bootstrap-vcpkg.sh" -disableMetrics
fi
# Generate build files with CMake
cmake ..
# Clean and configure
rm -rf build
cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
# Build the project
make
# Build all targets
cmake --build build --config Release
echo "Build completed!"
cd ..
echo "Build completed. Artifacts:"
echo " - Library: build/libprivatebinapi.so"
echo " - Example: build/example/example"