-
Notifications
You must be signed in to change notification settings - Fork 170
Expand file tree
/
Copy pathbuild_cpp_client.sh
More file actions
executable file
·42 lines (34 loc) · 1.11 KB
/
Copy pathbuild_cpp_client.sh
File metadata and controls
executable file
·42 lines (34 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
# Copyright (C) Microsoft Corporation.
# Copyright (C) 2025 IAMAI CONSULTING CORP
# MIT License.
set -euo pipefail
usage() {
cat <<'EOF'
Usage: ./build_cpp_client.sh [debug|release] [--tests]
Build the standalone ProjectAirSim C++ client without building SimLibs.
debug Build Debug artifacts (default).
release Build Release artifacts.
--tests Build and run the mocked unit tests. A simulator is not required.
EOF
}
build_type=Debug
run_tests=false
for arg in "$@"; do
case "$arg" in
debug) build_type=Debug ;;
release) build_type=Release ;;
--tests|--test) run_tests=true ;;
-h|--help) usage; exit 0 ;;
*) echo "Unknown argument: $arg" >&2; usage >&2; exit 2 ;;
esac
done
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
build_dir="$root_dir/client/cpp/build_linux/$build_type"
cmake -S "$root_dir/client/cpp" -B "$build_dir" -G Ninja \
-DCMAKE_BUILD_TYPE="$build_type" \
-DBUILD_TESTING="$run_tests"
cmake --build "$build_dir" --parallel
if "$run_tests"; then
ctest --test-dir "$build_dir" --output-on-failure
fi