Skip to content

Commit

Permalink
autopilot: update build script to support native builds
Browse files Browse the repository at this point in the history
  • Loading branch information
spernsteiner committed Sep 18, 2024
1 parent aee35d9 commit ea5e1dc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
25 changes: 20 additions & 5 deletions components/autopilot/ardupilot_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,31 @@ set -euo pipefail

# Build the ArduPilot SITL binary for aarch64.

target=
if [[ "$#" -ne 0 ]]; then
target="$1"
fi

build_dir=build
if [[ -n "$target" ]]; then
build_dir="$build_dir.$target"
fi

cd "$(dirname "$0")/ardupilot"

edo() {
echo " >> $*" 1>&2
"$@"
}

case "$target" in
aarch64)
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
export LD=aarch64-linux-gnu-g++
;;
esac

. venv/bin/activate
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
export LD=aarch64-linux-gnu-g++
./waf -o build.aarch64 configure --board sitl
./waf -o build.aarch64 build --target bin/arduplane
./waf -o "${build_dir}" configure --board sitl
./waf -o "${build_dir}" build --target bin/arduplane
2 changes: 1 addition & 1 deletion src/pkvm_setup/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ ardupilot_get_input_hashes() {
}

ardupilot_build() {
bash components/autopilot/ardupilot_build.sh
bash components/autopilot/ardupilot_build.sh aarch64
}

ardupilot_list_outputs() {
Expand Down

0 comments on commit ea5e1dc

Please sign in to comment.