forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
193 lines (177 loc) · 5.81 KB
/
BUILD.bazel
File metadata and controls
193 lines (177 loc) · 5.81 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# This file is named BUILD.bazel instead of the more typical BUILD, so that on
# OSX it won't conflict with a build artifacts directory named "build".
load("//tools/install:install.bzl", "install", "install_test")
load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:drake_py.bzl", "drake_py_library")
package(
default_visibility = ["//visibility:public"],
)
exports_files([
"CPPLINT.cfg",
".bazelproject",
".clang-format",
".drake-find_resource-sentinel",
".ruff.toml",
"package.xml",
])
exports_files(
[
"MODULE.bazel",
"cmake/MODULE.bazel.in",
],
visibility = ["//tools/workspace:__pkg__"],
)
# A legacy hack module to disambiguate the 'drake' module when Drake is being
# used as a non-bzlmod external. We should remove this when we drop support for
# WORKSPACE (i.e., Bazel >= 9).
drake_py_library(
name = "module_py",
srcs = ["__init__.py"],
visibility = ["//lcmtypes:__pkg__"],
)
# Expose shared library for (a) installed binaries, (b) Drake Python bindings,
# and (c) downstream C++ libraries which will also provide Python bindings.
alias(
name = "drake_shared_library",
actual = "//tools/install/libdrake:drake_shared_library",
visibility = ["//visibility:public"],
)
# A manually-curated collection of most model files in Drake, so that we can
# easily provide access to them for tools like //tools:model_visualizer.
filegroup(
name = "all_models",
data = [
"//bindings/pydrake/multibody:models",
"//examples/acrobot:models",
"//examples/hardware_sim:demo_data",
"//examples/hydroelastic/ball_plate:models",
"//examples/hydroelastic/python_ball_paddle:models",
"//examples/hydroelastic/python_nonconvex_mesh:models",
"//examples/hydroelastic/spatula_slip_control:models",
"//examples/kuka_iiwa_arm/models",
"//examples/multibody/cart_pole:models",
"//examples/multibody/deformable:models",
"//examples/multibody/four_bar:models",
"//examples/pendulum:models",
"//examples/planar_gripper:models",
"//examples/quadrotor:models",
"//examples/scene_graph:models",
"//examples/simple_gripper:models",
"//multibody/benchmarks/acrobot:models",
"@drake_models",
],
visibility = ["//:__subpackages__"],
)
# A manually-curated collection of some test model files in Drake, for use by
# //tools:model_visualizer_private.
filegroup(
name = "some_test_models",
testonly = True,
data = [
# It's okay to add more items to this list, as needed.
"//geometry/render:test_models",
"//manipulation/util:test_models",
"//manipulation/util:test_directives",
"//multibody/parsing:test_models",
"//geometry:test_obj_files",
"//geometry:test_stl_files",
"//geometry:test_vtk_files",
"//geometry:environment_maps",
"//geometry/render_gltf_client:merge_resources",
"//geometry/render_gltf_client:gltf_client_test_models",
],
visibility = ["//tools:__pkg__"],
)
_INSTALL_TEST_COMMANDS = "install_test_commands"
# These are the (only) files from our root directory which are installed. Note
# that even though the "data_dest" and "doc_dest" seem to be redundant with the
# default value for those attributes, that is not the case with bzlmod (where
# the default repository is named "_main" not "drake").
install(
name = "install_files",
data = [
".drake-find_resource-sentinel",
"package.xml",
],
data_dest = "share/drake",
docs = ["LICENSE.TXT"],
doc_dest = "share/doc/drake",
visibility = ["//visibility:private"],
)
config_setting(
name = "install_python_true",
flag_values = {
"//tools/flags:install_python": "True",
},
)
config_setting(
name = "lcm_runtime_true_and_install_libdrake_static",
flag_values = {
"//tools/flags:with_lcm_runtime": "True",
"//tools/flags:install_libdrake": "static",
},
)
config_setting(
name = "install_python_true_and_install_libdrake_static",
flag_values = {
"//tools/flags:install_python": "True",
"//tools/flags:install_libdrake": "static",
},
)
install(
name = "install",
install_tests_script = _INSTALL_TEST_COMMANDS,
target_compatible_with = select({
"install_python_true_and_install_libdrake_static": [
"@platforms//:incompatible",
],
"lcm_runtime_true_and_install_libdrake_static": [
"@platforms//:incompatible",
],
"//conditions:default": [],
}),
deps = [
":install_files",
"//common:install",
"//examples:install",
"//geometry:install",
"//lcmtypes:install",
"//multibody/parsing:install",
"//setup:install",
"//tools/install/libdrake:install",
"//tools/workspace:install_external_packages",
] + select({
"//:install_python_true": [
"//bindings/pydrake:install",
"//tutorials:install",
],
"//conditions:default": [],
}),
)
install_test(
name = "install_test",
opt_out_conditions = [
# Running acceptance tests under coverage (kcov) probably burns more CI
# time and flakiness compared to any upside.
"//tools/kcov:enabled",
# Running acceptance tests under Valgrind tools is extremely slow and
# of limited value, so skip them.
"//tools/valgrind:enabled",
],
args = ["--install_tests_filename=$(location :{})".format(
_INSTALL_TEST_COMMANDS,
)],
data = [
":install",
_INSTALL_TEST_COMMANDS,
],
)
add_lint_tests(
bazel_lint_extra_srcs = glob(
[
"cmake/external/workspace/**/*.bazel.in",
"cmake/external/workspace/**/*.bzl",
],
allow_empty = False,
),
)