diff --git a/tools/workspace/common_robotics_utilities/package.BUILD.bazel b/tools/workspace/common_robotics_utilities/package.BUILD.bazel index 41436048f898..173f7235ef42 100644 --- a/tools/workspace/common_robotics_utilities/package.BUILD.bazel +++ b/tools/workspace/common_robotics_utilities/package.BUILD.bazel @@ -18,6 +18,7 @@ cc_library( "include/common_robotics_utilities/base64_helpers.hpp", "include/common_robotics_utilities/color_builder.hpp", "include/common_robotics_utilities/conversions.hpp", + "include/common_robotics_utilities/cru_namespace.hpp", "include/common_robotics_utilities/dynamic_spatial_hashed_voxel_grid.hpp", # noqa "include/common_robotics_utilities/gaussian_distributions.hpp", "include/common_robotics_utilities/math.hpp", diff --git a/tools/workspace/common_robotics_utilities/patches/vendor.patch b/tools/workspace/common_robotics_utilities/patches/vendor.patch new file mode 100644 index 000000000000..de83f451b56d --- /dev/null +++ b/tools/workspace/common_robotics_utilities/patches/vendor.patch @@ -0,0 +1,13 @@ +[cru] Use hidden linker visibility + +This prevents ODR violations in case downstream code also links to CRU. + +--- include/common_robotics_utilities/cru_namespace.hpp ++++ include/common_robotics_utilities/cru_namespace.hpp +@@ -17,5 +17,5 @@ + + #ifndef CRU_NAMESPACE_BEGIN +-# define CRU_NAMESPACE_BEGIN inline namespace v1 { ++# define CRU_NAMESPACE_BEGIN inline namespace drake_vendor __attribute__ ((visibility ("hidden"))) { + #endif + diff --git a/tools/workspace/common_robotics_utilities/repository.bzl b/tools/workspace/common_robotics_utilities/repository.bzl index ee45207e217a..79cd4a136483 100644 --- a/tools/workspace/common_robotics_utilities/repository.bzl +++ b/tools/workspace/common_robotics_utilities/repository.bzl @@ -15,8 +15,11 @@ def common_robotics_utilities_repository( updated in ToyotaResearchInstitute/common_robotics_utilities/test/ or ToyotaResearchInstitute/common_robotics_utilities/CMakeLists.txt.ros2 """, - commit = "d82b404cf097d52ffa67955f2d57687d1851d4fe", - sha256 = "657a0d53c693f7dab7bd19eb10ecf98fdaf1add94f2f503ea6622c8e3606dd73", # noqa + commit = "f4c8d5538ed9a9ec26d4c76a059f282d70c69529", + sha256 = "49268f2f6677f06adf566516e73a29744d8d7665184bac8dac40d599abc0d14a", # noqa build_file = ":package.BUILD.bazel", + patches = [ + ":patches/vendor.patch", + ], mirrors = mirrors, )