From b238f199a9775723f40a0466475b08adf7b51a5e Mon Sep 17 00:00:00 2001 From: Jeremy Nimmer Date: Tue, 31 May 2022 10:54:38 -0700 Subject: [PATCH] [workspace] Remove msgpack boost dependency (#17286) * [workspace] Remove msgpack boost dependency --- geometry/meshcat.cc | 4 ++++ tools/workspace/msgpack/repository.bzl | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/geometry/meshcat.cc b/geometry/meshcat.cc index 152fc00cbc26..4246e9ed61b3 100644 --- a/geometry/meshcat.cc +++ b/geometry/meshcat.cc @@ -32,6 +32,10 @@ #include "drake/common/unused.h" #include "drake/geometry/meshcat_types.h" +#ifdef BOOST_VERSION +# error Drake should be using the non-boost flavor of msgpack. +#endif + // Steal one function declaration from usockets/src/internal/internal.h. extern "C" { void us_internal_free_closed_sockets(struct us_loop_t*); diff --git a/tools/workspace/msgpack/repository.bzl b/tools/workspace/msgpack/repository.bzl index 6ee088cd8261..32e543c0fc6f 100644 --- a/tools/workspace/msgpack/repository.bzl +++ b/tools/workspace/msgpack/repository.bzl @@ -28,7 +28,10 @@ def _impl(repo_ctx): prefix = "{}/opt/msgpack-cxx/".format(os_result.homebrew_prefix) repo_ctx.symlink("{}/include".format(prefix), "msgpack") - hdrs_patterns = ["msgpack/**/*.hpp"] + hdrs_patterns = [ + "msgpack/**/*.h", + "msgpack/**/*.hpp", + ] file_content = """# -*- python -*- @@ -40,9 +43,8 @@ cc_library( name = "msgpack", hdrs = glob({}), includes = ["msgpack"], + defines = ["MSGPACK_NO_BOOST"], visibility = ["//visibility:public"], - deps = ["@boost//:boost_headers"], - ) """.format(hdrs_patterns)