-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
drake_py_per_os.bzl
47 lines (42 loc) · 1.22 KB
/
drake_py_per_os.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
# This is a separate file from drake_py.bzl because the dependency on
# @drake_detected_os is somewhat brittle and might present challenges
# for users exploring novel platforms.
load(
"@drake//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_unittest",
)
load(
"@drake_detected_os//:os.bzl",
"UBUNTU_RELEASE",
)
def drake_py_binary_ubuntu_only(
name,
visibility = ["//visibility:private"],
**kwargs):
"""Declares a drake_py_binary iff we are building on Ubuntu.
Otherwise, does nothing.
The visibility defaults to private because this binary is not
cross-platform.
"""
if UBUNTU_RELEASE != None:
drake_py_binary(
name = name,
visibility = visibility,
**kwargs
)
def drake_py_unittest_ubuntu_only(
name,
visibility = ["//visibility:private"],
**kwargs):
"""Declares a drake_py_unittest iff we are building on Ubuntu.
Otherwise, does nothing.
The visibility defaults to private because this binary is not
cross-platform.
"""
if UBUNTU_RELEASE != None:
drake_py_unittest(
name = name,
visibility = visibility,
**kwargs
)