Skip to content

Commit

Permalink
[workspace] Reduce header footprint of generated LCM messages (#17289)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwnimmer-tri authored May 31, 2022
1 parent 5a76870 commit 3de381a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/kuka_iiwa_arm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ drake_cc_binary(
"//lcmtypes:robot_plan",
"//multibody/parsing",
"//multibody/plant",
"@lcm",
],
)

Expand Down
4 changes: 2 additions & 2 deletions tools/workspace/lcm/lcm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions tools/workspace/lcm/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 3de381a

Please sign in to comment.