Skip to content

Commit

Permalink
show error when navigation workspace is tring to be built with differ…
Browse files Browse the repository at this point in the history
…ent mode debug/release

Signed-off-by: Daisuke Sato <daisukes@cmu.edu>
  • Loading branch information
daisukes committed Feb 5, 2025
1 parent 2248a48 commit fc7d3d0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docker/clean_ws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
wd=`dirname $0`

for name in loc_ws people_ws people_nuc_wc ros2_ws bag_ws; do
rm -rf $wd/home/$name/build
rm -rf $wd/home/$name/install
rm -rf $wd/home/$name/log
rm -rf $wd/home/$name/build/*
rm -rf $wd/home/$name/install/*
rm -rf $wd/home/$name/log/*
rm -rf $wd/home/$name/DEBUG_BUILD
rm -rf $wd/home/$name/RELEASE_BUILD
done

21 changes: 21 additions & 0 deletions script/cabot_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,30 @@ while getopts "d" arg; do
done
shift $((OPTIND-1))

if [[ -e DEBUG_BUILD ]] && [[ $debug -eq 0 ]]; then
echo "WORKSPACE IS BUILT WITH DEBUG -d"
echo "You are tring to build the workspace without debug flag, where you have built with the debug flag before"
echo "Your options are"
echo " ./bild-workspace.sh -d"
echo " ./docker/clean_ws.sh"
echo " rm docker/home/ros2_ws/DEBUG_BUILD"
exit 1
fi
if [[ -e RELEASE_BUILD ]] && [[ $debug -eq 1 ]]; then
echo "WORKSPACE IS BUILT WITHOUT DEBUG"
echo "You are tring to build the workspace with debug flag, where you have built without the debug flag before"
echo "Your options are"
echo " ./bild-workspace.sh"
echo " ./docker/clean_ws.sh"
echo " rm docker/home/ros2_ws/RELEASE_BUILD"
exit 1
fi

if [[ $debug -eq 1 ]]; then
touch DEBUG_BUILD
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Debug --symlink-install --executor sequential $@
else
touch RELEASE_BUILD
colcon build --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo --executor sequential $@
fi

Expand Down

0 comments on commit fc7d3d0

Please sign in to comment.