diff --git a/examples/kuka_iiwa_arm/BUILD.bazel b/examples/kuka_iiwa_arm/BUILD.bazel index 3a04b59a8395..033111d52b9d 100644 --- a/examples/kuka_iiwa_arm/BUILD.bazel +++ b/examples/kuka_iiwa_arm/BUILD.bazel @@ -134,6 +134,7 @@ drake_cc_binary( "//lcmtypes:robot_plan", "//multibody/parsing", "//multibody/plant", + "@lcm", ], ) diff --git a/tools/workspace/lcm/lcm.bzl b/tools/workspace/lcm/lcm.bzl index e2f1e58acefa..d456b519e2fe 100644 --- a/tools/workspace/lcm/lcm.bzl +++ b/tools/workspace/lcm/lcm.bzl @@ -206,8 +206,8 @@ def lcm_cc_library( ) deps = kwargs.pop("deps", []) - if "@lcm" not in deps: - deps = deps + ["@lcm"] + if "@lcm//:lcm_coretypes" not in deps: + deps = deps + ["@lcm//:lcm_coretypes"] includes = kwargs.pop("includes", []) if "." not in includes: diff --git a/tools/workspace/lcm/package.BUILD.bazel b/tools/workspace/lcm/package.BUILD.bazel index 46f20f1c62bc..970a997f48ba 100644 --- a/tools/workspace/lcm/package.BUILD.bazel +++ b/tools/workspace/lcm/package.BUILD.bazel @@ -115,6 +115,14 @@ cc_library( includes = LCM_PUBLIC_HEADER_INCLUDES, ) +# This is the header-only library used by generated messages. +cc_library( + name = "lcm_coretypes", + hdrs = ["lcm/lcm_coretypes.h"], + includes = ["."], + linkstatic = True, +) + cc_binary( name = "lcm-logger", srcs = [