Skip to content

Commit

Permalink
Add compilation script to build all targets
Browse files Browse the repository at this point in the history
  • Loading branch information
joaofl committed Jan 8, 2024
1 parent 03dd2b6 commit 02b3aaf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
/.idea
/.vscode
/assets
20 changes: 20 additions & 0 deletions cross-build-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# List of target platforms
TARGETS=("x86_64-unknown-linux-gnu" "x86_64-pc-windows-gnu" "arm-unknown-linux-gnueabi" "aarch64-unknown-linux-gnu")

mkdir assets

# Cross-compile for each target platform
for target in "${TARGETS[@]}"; do
echo "Cross-compiling for $target..."
cross build --release --target "$target" --jobs $(nproc)
echo "$target compilation completed."

cp -v target/${target}/release/quick-serve assets/quick-serve-${target} 2>/dev/null
cp -v target/${target}/release/quick-serve.exe assets/quick-serve.exe-${target} 2>/dev/null
done

# Clean up
echo "Cleaning up..."
cargo clean

0 comments on commit 02b3aaf

Please sign in to comment.