This commit is contained in:
@ -6,7 +6,9 @@
|
||||
|
||||
set -e
|
||||
|
||||
rm -f build_amd64/dropshell build_arm64/dropshell build/dropshell.amd64 build/dropshell.arm64
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
rm -f $SCRIPT_DIR/build_amd64/dropshell $SCRIPT_DIR/build_arm64/dropshell $SCRIPT_DIR/output/dropshell.amd64 $SCRIPT_DIR/output/dropshell.arm64
|
||||
|
||||
# Determine number of CPU cores for parallel build
|
||||
if command -v nproc >/dev/null 2>&1; then
|
||||
@ -15,6 +17,9 @@ else
|
||||
JOBS=4 # fallback default
|
||||
fi
|
||||
|
||||
PREV_PWD=$PWD
|
||||
cd $SCRIPT_DIR
|
||||
|
||||
# Build for amd64 (musl)
|
||||
echo "Building for amd64 (musl)..."
|
||||
cmake -B build_amd64 -DCMAKE_BUILD_TYPE=Release \
|
||||
@ -23,8 +28,8 @@ cmake -B build_amd64 -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-static" \
|
||||
-DCMAKE_CXX_FLAGS="-march=x86-64" .
|
||||
cmake --build build_amd64 --target dropshell --config Release -j"$JOBS"
|
||||
mkdir -p build
|
||||
cp build_amd64/dropshell build/dropshell.amd64
|
||||
mkdir -p output
|
||||
cp build_amd64/dropshell output/dropshell.amd64
|
||||
|
||||
# Build for arm64 (musl)
|
||||
echo "Building for arm64 (musl)..."
|
||||
@ -35,18 +40,20 @@ cmake -B build_arm64 -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_FLAGS="-march=armv8-a" \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=aarch64 .
|
||||
cmake --build build_arm64 --target dropshell --config Release -j"$JOBS"
|
||||
mkdir -p build
|
||||
cp build_arm64/dropshell build/dropshell.arm64
|
||||
mkdir -p output
|
||||
cp build_arm64/dropshell output/dropshell.arm64
|
||||
|
||||
if [ ! -f build/dropshell.amd64 ]; then
|
||||
echo "build/dropshell.amd64 not found!" >&2
|
||||
if [ ! -f output/dropshell.amd64 ]; then
|
||||
echo "output/dropshell.amd64 not found!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f build/dropshell.arm64 ]; then
|
||||
echo "build/dropshell.arm64 not found!" >&2
|
||||
if [ ! -f output/dropshell.arm64 ]; then
|
||||
echo "output/dropshell.arm64 not found!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Builds complete:"
|
||||
ls -lh build/dropshell.*
|
||||
ls -lh output/dropshell.*
|
||||
|
||||
cd $PREV_PWD
|
Reference in New Issue
Block a user