-
Notifications
You must be signed in to change notification settings - Fork 6
/
BUILD
49 lines (39 loc) · 1.09 KB
/
BUILD
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
load("//:libnas-cpp.bzl", "extract_binary_names")
# build library
cc_library(
name = "nascodec-cpp",
srcs = glob(["src/**/*.cpp"]),
hdrs = glob(["include/**/*.h"]),
includes = ["include"],
copts = ["-Werror"]
)
# build examples
[ cc_binary(
name = files[1],
srcs = [files[0]] + glob(["example/include/**/*.h"]),
deps = [":nascodec-cpp"],
linkstatic = True,
copts = ["-Werror"]
)
for files in extract_binary_names(glob(["example/**/*.cpp"])) ]
# test examples
[ sh_test(
name = files[1] + "_test",
srcs = [ ":" + files[1]],
timeout = "short",
) for files in extract_binary_names(glob(["example/**/*.cpp"])) ]
# build tests
[ cc_binary(
name = files[1],
srcs = [files[0]] + glob(["test/include/**/*.h"]),
deps = [":nascodec-cpp"],
linkstatic = True,
copts = ["-Werror", "-Itest/include"]
)
for files in extract_binary_names(glob(["test/**/*.cpp"])) ]
# execute tests
[ sh_test(
name = files[1] + "_test",
srcs = [ ":" + files[1]],
timeout = "short",
) for files in extract_binary_names(glob(["test/**/*.cpp"])) ]