-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.bzl
37 lines (31 loc) · 906 Bytes
/
build.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
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test")
def create_test_target(name, extra_deps = None):
if extra_deps == None:
extra_deps = []
cc_test(
name = name,
srcs = [name + ".cpp"],
deps = ["//:common"] + extra_deps,
linkopts = ["-lgtest"],
linkstatic = True,
)
def create_example_target(example_name, extra_deps = None):
if extra_deps == None:
extra_deps = []
exec_name = example_name.split('-', 1)[1]
cc_binary(
name = exec_name,
srcs = [example_name + ".cpp"],
deps = ["//:common"] + extra_deps
)
def create_benchmark_target(name, extra_deps = None):
if extra_deps == None:
extra_deps = []
cc_binary(
name = name,
srcs = [name + ".cpp"],
deps = [
"//:common",
"//benchmark:bench_common",
] + extra_deps,
)