#!/usr/bin/env bash # Initialize only the codec-related git submodules needed for the NDK build. # Called by rebuild.sh before the native build step. set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$ROOT" SUBMODULES=( "third-party/libvpx" "third-party/opus" "third-party/speex" "third-party/wireguard-android" ) for sm in "${SUBMODULES[@]}"; do if [[ -d "$sm/.git" ]] || git -C "$sm" rev-parse --git-dir >/dev/null 2>&1; then echo "==> Submodule already initialized: $sm" else echo "==> Initializing submodule: $sm" git submodule update --init -- "$sm" fi done