forked from bazelbuild/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD
136 lines (129 loc) · 2.8 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#
# Copyright 2015 The Bazel Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package(default_visibility = ["//visibility:public"])
cc_library(
name = "util",
srcs = [
"util/arena.cc",
"util/hash.cc",
"util/rune.cc",
"util/stringpiece.cc",
"util/stringprintf.cc",
"util/strutil.cc",
"util/valgrind.cc",
],
hdrs = glob(["util/*.h"]),
includes = ["."],
)
cc_library(
name = "re2",
srcs = [
"re2/bitstate.cc",
"re2/compile.cc",
"re2/dfa.cc",
"re2/filtered_re2.cc",
"re2/mimics_pcre.cc",
"re2/nfa.cc",
"re2/onepass.cc",
"re2/parse.cc",
"re2/perl_groups.cc",
"re2/prefilter.cc",
"re2/prefilter_tree.cc",
"re2/prog.cc",
"re2/re2.cc",
"re2/regexp.cc",
"re2/set.cc",
"re2/simplify.cc",
"re2/tostring.cc",
"re2/unicode_casefold.cc",
"re2/unicode_groups.cc",
],
hdrs = [
"re2/prog.h",
"re2/re2.h",
"re2/regexp.h",
"re2/unicode_casefold.h",
"re2/unicode_groups.h",
"re2/walker-inl.h",
],
linkopts = ["-lm"], # C++ random pulls in math.h
deps = [":util"],
)
cc_library(
name = "testutil",
srcs = glob(
[
"re2/testing/*.cc",
"util/pcre.cc",
"util/random.cc",
"util/thread.cc",
],
exclude = [
"re2/testing/*_test.cc",
"re2/testing/*_benchmark.cc",
],
),
deps = [
":re2",
":util",
],
)
cc_library(
name = "bench-main",
srcs = [
"util/benchmark.cc",
],
deps = [
":testutil",
],
)
cc_library(
name = "test-main",
srcs = [
"util/test.cc",
],
deps = [
":testutil",
],
)
[cc_test(
name = f[:-3],
srcs = [
f,
],
linkopts = [
"-lstdc++",
"-lpthread",
],
deps = [
":re2",
":test-main",
],
) for f in glob(["re2/testing/*_test.cc"])]
[cc_test(
name = f[:-3],
srcs = [
f,
],
linkopts = [
"-lstdc++",
"-lpthread",
],
deps = [
":bench-main",
":re2",
],
) for f in glob(["re2/testing/*_benchmark.cc"])]