Skip to content

Refactor rosidl_buffer_registry to use modern CMake targets - #1

Open
karsten-nvidia wants to merge 2 commits into
nvcyc:rolling-native-bufferfrom
karsten-nvidia:rolling-native-buffer
Open

karsten-nvidia wants to merge 2 commits into
nvcyc:rolling-native-bufferfrom
karsten-nvidia:rolling-native-buffer

Conversation

@karsten-nvidia

Copy link
Copy Markdown

Summary

Replace deprecated ament_target_dependencies() with modern CMake target_link_libraries() using namespace targets.

Changes

  • rosidl_buffer_registry/CMakeLists.txt:
    • Line 33: Changed from ament_target_dependencies() to target_link_libraries(PUBLIC)
    • Line 73: Applied same pattern for test target
    • Uses namespace targets: rmw::rmw, rosidl_runtime_cpp::rosidl_runtime_cpp, pluginlib::pluginlib

Motivation

  1. Alignment with modern ROS 2 packages: Other packages (pluginlib, class_loader) use this pattern
  2. Resolves build issues: Fixes compatibility when ament_cmake is used without ament_cmake_ros
  3. Best practices: Namespace targets are the recommended CMake approach

Testing

  • ✅ rosidl_buffer_registry builds successfully
  • ✅ All downstream packages build (rmw_zenoh_cpp, etc.)
  • ✅ No circular dependency issues

Related

This change works in conjunction with removing ament_cmake_ros dependency from class_loader to resolve circular dependencies in the ROS 2 build system.

nvcyc and others added 2 commits February 3, 2026 22:58
Replace deprecated ament_target_dependencies() with modern CMake
target_link_libraries() using namespace targets (rmw::rmw,
rosidl_runtime_cpp::rosidl_runtime_cpp, pluginlib::pluginlib).

This pattern aligns with other modern ROS 2 packages (pluginlib,
class_loader) and resolves build issues when ament_cmake is used
without ament_cmake_ros.

Changes:
- Line 33: target_link_libraries(PUBLIC) instead of ament_target_dependencies()
- Line 73: Same pattern for test target

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
karsten-nvidia added a commit to karsten-nvidia/ros2 that referenced this pull request Feb 5, 2026
Point to karsten-nvidia forks with circular dependency fixes:
- class_loader: Remove ament_cmake_ros dependency
- rosidl: Refactor rosidl_buffer_registry to modern CMake targets

These changes resolve circular dependency blocking ROS 2 builds on
the rcl_buffer branch.

Related:
- class_loader PR: https://github.com/karsten-nvidia/class_loader/tree/fix-circular-dependency-remove-ament-cmake-ros
- rosidl PR to nvcyc: nvcyc/rosidl#1

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@nvcyc
nvcyc force-pushed the rolling-native-buffer branch from c38418d to e6dff7d Compare February 6, 2026 19:37
@nvcyc
nvcyc force-pushed the rolling-native-buffer branch from c874df7 to 980eea0 Compare March 13, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants