Tools: add WebAssembly SITL support

This commit is contained in:
Graham
2026-09-22 12:59:21 +10:00
committed by Peter Barker
parent 39cbc30398
commit 640c74e76c
2 changed files with 33 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
set -e
set -x
EMSCRIPTEN_VERSION=${EMSCRIPTEN_VERSION:-6.0.8}
EMSDK_ROOT=${EMSDK_ROOT:-$HOME/emsdk}
SHELL_LOGIN=${SHELL_LOGIN:-.profile}
if ! python3 -c 'import sys; sys.exit(sys.version_info < (3, 10))'; then
echo "Emscripten SDK requires Python 3.10 or newer."
exit 1
fi
if [ ! -d "$EMSDK_ROOT/.git" ]; then
git clone https://github.com/emscripten-core/emsdk.git "$EMSDK_ROOT"
else
if ! git -C "$EMSDK_ROOT" pull --ff-only; then
echo "Warning: could not update emsdk; continuing with the existing checkout." >&2
fi
fi
"$EMSDK_ROOT/emsdk" install "$EMSCRIPTEN_VERSION"
"$EMSDK_ROOT/emsdk" activate "$EMSCRIPTEN_VERSION"
exportline_wasm=". \"$EMSDK_ROOT/emsdk_env.sh\" >/dev/null"
grep -Fxq "$exportline_wasm" "$HOME/$SHELL_LOGIN" 2>/dev/null || echo "$exportline_wasm" >> "$HOME/$SHELL_LOGIN"
eval "$exportline_wasm"
+5
View File
@@ -312,6 +312,11 @@ class TestNewBoards(BuildScriptBase):
self.progress(f"Skipping arm-linux board {board.name}")
continue
# Skip Emscripten boards - CI machine doesn't have the SDK
if board.toolchain == "emscripten":
self.progress(f"Skipping Emscripten board {board.name}")
continue
self.progress(f"Building board {board.name}")
if boards_to_test[board_name].test_vehicles:
self.build_board(board)