#!/bin/bash
# Script to build the health analytics C++ library for Linux

# Create build directory
mkdir -p build/linux/lib

# Compile the C++ library
g++ -std=c++17 -shared -fPIC \
-o build/linux/lib/libhealth_analytics.so \
native/statistics/health_analytics.cpp \
-I native/statistics

# Copy the library to all locations where it might be needed
mkdir -p build/linux/x64/debug/bundle/lib
cp build/linux/lib/libhealth_analytics.so build/linux/x64/debug/bundle/lib/
cp build/linux/lib/libhealth_analytics.so build/linux/x64/debug/bundle/
cp build/linux/lib/libhealth_analytics.so ./

echo "Health Analytics C++ library built successfully!"