1#!/usr/bin/env bash
2# Copyright 2018 Oticon A/S
3# SPDX-License-Identifier: Apache-2.0
4
5# Compile all the applications needed by the Bluetooth bsim tests
6
7#set -x #uncomment this line for debugging
8set -ue
9: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root directory}"
10
11source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
12
13# Note: We do not parallelize the call into the build of the host, ll and mesh images as those
14# are already building many images in parallel in themselves, and otherwise we would be
15# launching too many parallel builds which can lead to a too high system load.
16# On the other hand the audio compile script, only builds one image. So we parallelize it with
17# the rest to save a couple of seconds.
18run_in_background ${ZEPHYR_BASE}/tests/bsim/bluetooth/audio/compile.sh
19${ZEPHYR_BASE}/tests/bsim/bluetooth/audio_samples/compile.sh
20${ZEPHYR_BASE}/tests/bsim/bluetooth/host/compile.sh
21${ZEPHYR_BASE}/tests/bsim/bluetooth/ll/compile.sh
22${ZEPHYR_BASE}/tests/bsim/bluetooth/mesh/compile.sh
23${ZEPHYR_BASE}/tests/bsim/bluetooth/samples/compile.sh
24if [ ${BOARD} == "nrf52_bsim/native" ]; then
25	${ZEPHYR_BASE}/tests/bsim/bluetooth/hci_uart/compile.sh
26fi
27
28wait_for_background_jobs
29