-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD
43 lines (39 loc) · 940 Bytes
/
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
cc_library(
name = "sog",
srcs = glob(["sog/*.cc"]),
hdrs = glob(["sog/*.h"]),
linkopts = ["-lboost_iostreams"],
visibility = [ "//visibility:public" ],
)
cc_library(
name = "sog_test",
srcs = glob(["sog/*.cc"]),
hdrs = glob(["sog/*.h"]),
defines = ["SOG_FAKE_SEC=950455800", "SOG_FAKE_USEC=50000"],
linkopts = ["-lboost_iostreams", "-lsystemd"],
)
cc_library(
name = "testlib",
srcs = glob(["test/*.cc"], exclude=glob(["test/*_test.cc"])),
hdrs = glob(["test/*.h"]),
deps = [
":sog_test",
],
linkopts = ["-lgtest_main", "-lgtest"],
)
[cc_test(
name = src[len("test/"):-len(".cc")],
srcs = [ src ],
deps = [
":testlib",
],
defines = ["_sog_LINE=1337"] if src != "test/macro_func_test.cc" else [],
) for src in glob(["test/*_test.cc"])]
[cc_test(
name = "example_" + src[len("example/"):-len(".cc")],
srcs = [ src ],
deps = [
":sog",
],
copts = ["-Wno-weak-vtables"],
) for src in glob(["example/*.cc"])]