-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-and-run.sh
More file actions
executable file
·42 lines (37 loc) · 1.05 KB
/
build-and-run.sh
File metadata and controls
executable file
·42 lines (37 loc) · 1.05 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
#!/bin/bash
set -exo pipefail
# Default build type
BUILD_TYPE="Release"
# Parse command line arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--build-type=*)
BUILD_TYPE="${1#*=}"
shift
;;
--build-type)
BUILD_TYPE="$2"
shift 2
;;
*)
echo "Unknown parameter passed: $1, exiting."
exit 1
;;
esac
done
if [[ -z "${DOCKER_FLAG_FOR_RUN_SCRIPT}" ]]; then
echo "Host (no docker) detected."
docker compose --progress plain up -d
echo "Docker container is now running, starting interactive shell. Run /app/build-and-run.sh inside the shell to proceed."
docker exec -it fanuc-ethernet-cpp-fanuc-ethernet-cpp-1 /bin/bash
else
echo "Docker detected."
cd /app/
cmake -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -S . -B /app/build
cmake --build /app/build -j $(nproc) -v
if [[ "${BUILD_TYPE}" = "Debug" ]]; then
gdb /app/build/src/tests/move_test
else
/app/build/src/tests/move_test
fi
fi