-
Notifications
You must be signed in to change notification settings - Fork 15
/
oss_or_google.bzl
38 lines (34 loc) · 905 Bytes
/
oss_or_google.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
"""
Module for build utilities to distiguish different build environment.
"""
# Whether the compilation environment is open source environment.
is_oss = True
# Helper build function.
# Returns the input if is_oss is true.
# Returns empty list otherwise.
def if_oss(a):
if is_oss:
return a
else:
return []
# Helper build function.
# Returns the input if is_oss is false.
# Returns empty list otherwise.
def if_google(a):
if is_oss:
return []
else:
return a
# cc_test that is only run in open source environment.
def oss_only_cc_test(name, srcs = [], deps = [], data = [], size = "medium", linkstatic = 0):
if is_oss:
return native.cc_test(
name = name,
deps = deps,
srcs = srcs,
data = data,
size = size,
linkstatic = linkstatic,
)
else:
return None