dropshell/multibuild.sh
Your Name 89095cdc50
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled
dropshell release 2025.0513.2200
2025-05-13 22:02:02 +12:00

46 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# build amd64 and arm64 versions of dropshell, to:
# build/dropshell.amd64
# build/dropshell.arm64
set -e
rm -f build_amd64/dropshell build_arm64/dropshell build/dropshell.amd64 build/dropshell.arm64
# Build for amd64 (musl)
echo "Building for amd64 (musl)..."
cmake -B build_amd64 -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=x86_64-linux-musl-gcc \
-DCMAKE_CXX_COMPILER=x86_64-linux-musl-g++ \
-DCMAKE_EXE_LINKER_FLAGS="-static" \
-DCMAKE_CXX_FLAGS="-march=x86-64" .
cmake --build build_amd64 --target dropshell --config Release
mkdir -p build
cp build_amd64/dropshell build/dropshell.amd64
# Build for arm64 (musl)
echo "Building for arm64 (musl)..."
cmake -B build_arm64 -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=aarch64-linux-musl-gcc \
-DCMAKE_CXX_COMPILER=aarch64-linux-musl-g++ \
-DCMAKE_EXE_LINKER_FLAGS="-static" \
-DCMAKE_CXX_FLAGS="-march=armv8-a" \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 .
cmake --build build_arm64 --target dropshell --config Release
mkdir -p build
cp build_arm64/dropshell build/dropshell.arm64
if [ ! -f build/dropshell.amd64 ]; then
echo "build/dropshell.amd64 not found!" >&2
exit 1
fi
if [ ! -f build/dropshell.arm64 ]; then
echo "build/dropshell.arm64 not found!" >&2
exit 1
fi
echo "Builds complete:"
ls -lh build/dropshell.*