-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.sh
executable file
·54 lines (49 loc) · 1.09 KB
/
build.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
display_usage() {
echo "Usage: "
echo "build.sh [--with-tests] [--standalone]"
echo ""
echo "Options:"
echo "--with-tests - build with tests."
echo "--standalone - standalone version"
}
if [ -z "${ROS_DISTRO}" ]; then
echo "Source your ros2 distro first (foxy, galactic, humble or rolling are supported)"
exit 1
fi
TESTS=0
MSG="Build started."
STANDALONE=OFF
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-t|--with-tests)
TESTS=1
MSG="$MSG (with tests)"
shift # past argument
;;
-s|--standalone)
STANDALONE=ON
MSG="$MSG (standalone)"
shift # past argument
;;
-h|--help)
display_usage
exit 0
shift # past argument
;;
*) # unknown option
shift # past argument
;;
esac
done
echo $MSG
colcon build \
--merge-install \
--event-handlers console_direct+ \
--cmake-args \
-DCMAKE_BUILD_TYPE=Release \
-DSTANDALONE_BUILD=$STANDALONE \
-DBUILD_TESTING=$TESTS \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-rpath,'\$ORIGIN',-rpath=.,--disable-new-dtags" \
--no-warn-unused-cli