diff --git a/README.md b/README.md index 12787c3..40e5a46 100644 --- a/README.md +++ b/README.md @@ -76,3 +76,4 @@ TODO - [For versions >= `v2.5.0`] Added rust support for all ROS distributions. Also, fixed bug #79 that was introduced in `v2.3.0`. - [For versions >= `v2.5.1`] Now deleting all problematic locks instead of just the oldest and fixed #85 (exec locks daemon bug). - [For versions >= `v2.5.2`] Fixed a bug that was introduced in `v2.4.0` where `rosez` and `rosezm` could get mixed up when used simultaneously (issue #88). +- [For versions >= `v2.5.3`] Added the ability to distinguish between `catkin_make` and `catkin build` workspaces in ROS1. Also, now using the `RelWithDebInfo` flag for all build commands. diff --git a/internal/entrypoint.bash b/internal/entrypoint.bash index bd1e647..64af7c3 100644 --- a/internal/entrypoint.bash +++ b/internal/entrypoint.bash @@ -49,10 +49,26 @@ if [ "$rosversion" != "unknown" ]; then intermediate_error_handler $? else if [ $skip_compilation -ne 1 ]; then - script --flush --quiet --return /tmp/rosez-build-output.txt --command "catkin_make" | tee /dev/fd/2 + catkin_tool="catkin_make" + cmake_extras="--cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo" + built_by_file=/opt/ros/"$bl"/build/.built_by + if [[ -f "$built_by_file" ]]; then + built_by=$(cat $built_by_file) + if [[ "$built_by" == "catkin_make" || "$built_by" == "catkin build" ]]; then + catkin_tool="$built_by" + else + echo -e "${colour_orange}${bl}: No catkin tool (catkin_make/catkin build) could be detected. Defaulting to catkin_make...$colour_end" + fi + fi + script --flush --quiet --return /tmp/rosez-build-output.txt --command "$catkin_tool $cmake_extras" | tee /dev/fd/2 intermediate_error_handler $? fi - . /opt/ros/$bl/devel/setup.bash + devel_setup_file="/opt/ros/$bl/devel/setup.bash" + if [[ -f "$devel_setup_file" ]]; then + . "$devel_setup_file" + else + echo -e "${colour_orange}${bl}: No setup.bash file was found under devel. Continuing without sourcing the workspace...$colour_end" + fi intermediate_error_handler $? fi done