first commit - migrated from codeberg
This commit is contained in:
commit
5ead03e1f7
567 changed files with 102721 additions and 0 deletions
44
scripts/build_statistics_android.sh
Executable file
44
scripts/build_statistics_android.sh
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/bin/bash
|
||||
# Build script for Android Health Analytics C++ library
|
||||
|
||||
# Set paths to your Android NDK and CMake tools
|
||||
NDK_PATH="/home/charlotte/Android/Sdk/ndk/29.0.13113456"
|
||||
CMAKE_PATH="/home/charlotte/Android/Sdk/cmake/3.22.1/bin/cmake"
|
||||
NINJA_PATH="/home/charlotte/Android/Sdk/cmake/3.22.1/bin/ninja"
|
||||
# Define the build directory (here for arm64-v8a)
|
||||
BUILD_DIR="build/android/arm64-v8a"
|
||||
|
||||
# Remove previous build directory if it exists
|
||||
rm -rf "$BUILD_DIR"
|
||||
mkdir -p "$BUILD_DIR"
|
||||
|
||||
# Configure the project using CMake with Android toolchain
|
||||
"$CMAKE_PATH" \
|
||||
-H. \
|
||||
-B"$BUILD_DIR" \
|
||||
-G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DANDROID_ABI=arm64-v8a \
|
||||
-DANDROID_PLATFORM=android-21 \
|
||||
-DANDROID_NDK="$NDK_PATH" \
|
||||
-DCMAKE_TOOLCHAIN_FILE="$NDK_PATH/build/cmake/android.toolchain.cmake" \
|
||||
-DCMAKE_MAKE_PROGRAM="$NINJA_PATH" \
|
||||
-DANDROID_STL=c++_shared
|
||||
|
||||
# Build the target library
|
||||
"$CMAKE_PATH" --build "$BUILD_DIR" --target statistics
|
||||
|
||||
# Create necessary directories for copying the library
|
||||
mkdir -p "$BUILD_DIR/lib"
|
||||
|
||||
# Copy the library from the correct location
|
||||
cp "$BUILD_DIR/linux/libstatistics.so" "$BUILD_DIR/lib/"
|
||||
cp "$BUILD_DIR/linux/libstatistics.so" ./
|
||||
|
||||
|
||||
# Check if the build was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Health Analytics C++ library built successfully for Android!"
|
||||
else
|
||||
echo "Android build failed."
|
||||
fi
|
19
scripts/build_statistics_linux.sh
Executable file
19
scripts/build_statistics_linux.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/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!"
|
Loading…
Add table
Add a link
Reference in a new issue