forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrake_lcm.bzl
66 lines (61 loc) · 1.88 KB
/
drake_lcm.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# -*- python -*-
load(
"//tools/workspace/lcm:lcm.bzl",
"lcm_cc_library",
"lcm_java_library",
"lcm_py_library",
)
load(
"@drake//tools/skylark:drake_cc.bzl",
"drake_installed_headers",
"installed_headers_for_drake_deps",
)
def drake_lcm_cc_library(
name,
deps = [],
tags = [],
strip_include_prefix = None,
**kwargs):
"""A wrapper to insert Drake-specific customizations."""
# Drake's *.lcm files all live in our //drake/lcmtypes package. Per LCM
# upstream convention, the include directory for generated code should
# always look like "my_lcm_package/my_lcm_struct.h", but by default Bazel
# would provide "drake/lcmtypes/my_lcm_package/my_lcm_struct.h" as an
# allowed spelling. Here, we override that to enforce that Drake's include
# statements use the standard formulation. (We allow callers to override
# our enforcement though, such as for special-case testing.)
if strip_include_prefix == None:
strip_include_prefix = "/" + native.package_name()
detail = lcm_cc_library(
name = name,
deps = deps,
tags = tags + ["nolint"],
strip_include_prefix = strip_include_prefix,
**kwargs
)
drake_installed_headers(
name = name + ".installed_headers",
hdrs = detail.hdrs,
deps = installed_headers_for_drake_deps(deps),
tags = ["nolint"],
)
def drake_lcm_java_library(
name,
tags = [],
**kwargs):
"""A wrapper to insert Drake-specific customizations."""
lcm_java_library(
name = name,
tags = tags + ["nolint"],
**kwargs
)
def drake_lcm_py_library(
name,
tags = [],
**kwargs):
"""A wrapper to insert Drake-specific customizations."""
lcm_py_library(
name = name,
tags = tags + ["nolint"],
**kwargs
)