Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions jenkins-scripts/docker/gz_transport-compilation.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ if [[ ${GZ_TRANSPORT_MAJOR_VERSION} -ge 6 ]]; then
export NEED_C17_COMPILER=true
fi

if [[ ${GZ_TRANSPORT_MAJOR_VERSION} -ge 15 ]]; then
# gz-transport version >= 15 will use zenoh_cpp_vendor package from ROS 2
# repo for zenoh support. Setting this env var will set up ROS env with the
# specified ROS distro in the generated build.sh script.
export ROS_DISTRO_SETUP_NEEDED="jazzy"
fi

export GZDEV_PROJECT_NAME="gz-transport${GZ_TRANSPORT_MAJOR_VERSION}"

. "${SCRIPT_DIR}/lib/generic-building-base.bash"
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,32 @@ DELIM_BUILD_DEPS
fi
done

# Minimal ROS env setup for finding ROS packages.
# We don't need a full ROS env setup for building ROS packages or running
# ROS tests. The ROS setup here is needed by gz-transport versions >= 15
# so that it can find ROS 2's zenoh_cpp_vendor package that is installed in
# /opt/ros/<ROS_DISTRO>.
# See jenkins-scripts/docker/gz_transport-compilation.bash
if [[ -n ${ROS_DISTRO_SETUP_NEEDED} ]]; then
cat >> build.sh << DELIM_ROS_DISTRO_SETUP
echo '# BEGIN SECTION: sourcing ros setup script'
if [ -f /opt/ros/${ROS_DISTRO_SETUP_NEEDED}/setup.bash ]; then
source /opt/ros/${ROS_DISTRO_SETUP_NEEDED}/setup.bash
else
echo "ROS_DISTRO_SETUP_NEEDED set to ${ROS_DISTRO_SETUP_NEEDED} but no ROS 2 installation found"
exit 1
fi
echo '# END SECTION'
DELIM_ROS_DISTRO_SETUP
fi

cat >> build.sh << DELIM
echo '# BEGIN SECTION: configure'
# Step 2: configure and build
cd $WORKSPACE
[[ ! -d $WORKSPACE/build ]] && mkdir -p $WORKSPACE/build
cd $WORKSPACE/build

cmake $WORKSPACE/${SOFTWARE_DIR} ${BUILDING_EXTRA_CMAKE_PARAMS} \
-DCMAKE_INSTALL_PREFIX=/usr
echo '# END SECTION'
Expand Down