-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathdrake.BUILD.bazel
93 lines (76 loc) · 1.9 KB
/
drake.BUILD.bazel
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
# -*- bazel -*-
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_python//python:defs.bzl", "py_library")
package(default_visibility = ["//visibility:private"])
# --- Resources stuff ---
_RUNFILES = glob([
"share/drake/**",
], exclude = [
"share/drake/common/**",
"share/drake/setup/**",
"share/drake/tutorials/**",
], allow_empty = False)
filegroup(
name = "_runfiles",
srcs = _RUNFILES,
)
# --- C++ stuff ---
_DRAKE_SHLIBS = glob([
"lib/libdrake*.so",
], allow_empty = False)
_THIRD_SHLIBS = glob([
# For Mosek (not enabled by default).
"lib/libtbb*.so*",
"lib/libmosek64*.so*",
# For Gurobi (not enabled by default).
"lib/libgurobi*.so*",
], allow_empty = True)
cc_library(
name = "_lcm_coretypes",
hdrs = ["include/lcm/lcm/lcm_coretypes.h"],
strip_include_prefix = "include/lcm",
)
cc_library(
name = "_drake_headers",
hdrs = glob(["include/drake/**"]),
strip_include_prefix = "include",
deps = [":_lcm_coretypes"],
)
[
cc_import(
name = "_imported{}".format(shlib),
shared_library = shlib,
)
for shlib in _DRAKE_SHLIBS + _THIRD_SHLIBS
]
cc_library(
name = "drake_shared_library",
data = [
":_runfiles",
],
deps = [
":_drake_headers",
"@eigen",
] + [
":_imported{}".format(shlib)
for shlib in _DRAKE_SHLIBS + _THIRD_SHLIBS
],
visibility = ["//visibility:public"],
)
# --- Python stuff ---
_PYDRAKE_PYS = glob([
"lib/python3.*/site-packages/**/*.py",
], allow_empty = False)
_PYDRAKE_SOS = glob([
"lib/python3.*/site-packages/**/*.so",
], allow_empty = False)
_IMPORT = _PYDRAKE_PYS[0][:len("lib/python3.##/site-packages")]
py_library(
name = "pydrake",
visibility = ["//visibility:public"],
srcs = _PYDRAKE_PYS,
data = _PYDRAKE_SOS + _DRAKE_SHLIBS + _THIRD_SHLIBS + [
":_runfiles",
],
imports = [_IMPORT],
)