blob: 4cb2121b7bb08e059bacc71a3847fc22653ccd97 [file] [log] [blame]
Paul Wankadiaf3a95882015-09-26 03:21:18 +10001# Copyright 2009 The RE2 Authors. All Rights Reserved.
2# Use of this source code is governed by a BSD-style
3# license that can be found in the LICENSE file.
4
Paul Wankadiaa96b4642015-04-27 20:29:47 +10005# Bazel (http://bazel.io/) BUILD file for RE2.
Ming Zhaodd223322015-04-21 11:41:18 -07006
7licenses(["notice"])
8
Shahms King63e4dbd2016-03-04 10:45:44 -08009exports_files(["LICENSE"])
10
Ming Zhaodd223322015-04-21 11:41:18 -070011cc_library(
Paul Wankadiaa96b4642015-04-27 20:29:47 +100012 name = "re2",
13 srcs = [
Paul Wankadiafb40e7d2016-08-04 20:20:03 +100014 "re2/bitmap256.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100015 "re2/bitstate.cc",
16 "re2/compile.cc",
17 "re2/dfa.cc",
18 "re2/filtered_re2.cc",
19 "re2/mimics_pcre.cc",
20 "re2/nfa.cc",
21 "re2/onepass.cc",
22 "re2/parse.cc",
23 "re2/perl_groups.cc",
24 "re2/prefilter.cc",
25 "re2/prefilter.h",
26 "re2/prefilter_tree.cc",
27 "re2/prefilter_tree.h",
28 "re2/prog.cc",
29 "re2/prog.h",
30 "re2/re2.cc",
31 "re2/regexp.cc",
32 "re2/regexp.h",
33 "re2/set.cc",
34 "re2/simplify.cc",
Paul Wankadia791beff2015-11-17 00:15:44 +110035 "re2/stringpiece.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100036 "re2/tostring.cc",
37 "re2/unicode_casefold.cc",
38 "re2/unicode_casefold.h",
39 "re2/unicode_groups.cc",
40 "re2/unicode_groups.h",
41 "re2/walker-inl.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100042 "util/flags.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100043 "util/logging.h",
Paul Wankadia1e8fade2016-08-16 22:27:03 +100044 "util/mix.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100045 "util/mutex.h",
46 "util/rune.cc",
47 "util/sparse_array.h",
48 "util/sparse_set.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100049 "util/strutil.cc",
Paul Wankadia95ce0cc2016-08-16 23:11:37 +100050 "util/strutil.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100051 "util/utf.h",
52 "util/util.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100053 ],
54 hdrs = [
55 "re2/filtered_re2.h",
56 "re2/re2.h",
57 "re2/set.h",
Paul Wankadia791beff2015-11-17 00:15:44 +110058 "re2/stringpiece.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100059 ],
Paul Wankadia46d730b2016-01-03 17:38:22 +110060 copts = ["-pthread"],
Paul Wankadiaa96b4642015-04-27 20:29:47 +100061 linkopts = ["-pthread"],
62 visibility = ["//visibility:public"],
Ming Zhaodd223322015-04-21 11:41:18 -070063)
64
Ming Zhaodd223322015-04-21 11:41:18 -070065cc_library(
Thiago Farina5f4c8552016-04-12 08:22:52 -030066 name = "testing",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100067 testonly = 1,
68 srcs = [
69 "re2/testing/backtrack.cc",
70 "re2/testing/dump.cc",
Paul Wankadiaf3a95882015-09-26 03:21:18 +100071 "re2/testing/exhaustive_tester.cc",
72 "re2/testing/null_walker.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100073 "re2/testing/regexp_generator.cc",
74 "re2/testing/string_generator.cc",
75 "re2/testing/tester.cc",
76 "util/pcre.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100077 ],
78 hdrs = [
Paul Wankadiaf3a95882015-09-26 03:21:18 +100079 "re2/testing/exhaustive_tester.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100080 "re2/testing/regexp_generator.h",
81 "re2/testing/string_generator.h",
82 "re2/testing/tester.h",
Paul Wankadiab12a3242016-04-14 14:34:20 +100083 "util/benchmark.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100084 "util/pcre.h",
Damien Martin-Guillerez5968df02016-03-31 17:35:34 +020085 "util/test.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100086 ],
Paul Wankadia791beff2015-11-17 00:15:44 +110087 deps = [":re2"],
Ming Zhaodd223322015-04-21 11:41:18 -070088)
89
Thiago Farina5f4c8552016-04-12 08:22:52 -030090cc_library(
91 name = "test",
Damien Martin-Guillerezfc5ff3b2016-10-20 11:52:13 +020092 testonly = 1,
Paul Wankadiab12a3242016-04-14 14:34:20 +100093 srcs = ["util/test.cc"],
Thiago Farina5f4c8552016-04-12 08:22:52 -030094 deps = [":testing"],
95)
96
Paul Wankadia5ca216d2017-10-11 21:33:59 +110097load("re2_test.bzl", "re2_test")
Ming Zhaodd223322015-04-21 11:41:18 -070098
Paul Wankadia5ca216d2017-10-11 21:33:59 +110099re2_test(
100 "charclass_test",
101 size = "small",
102)
Shahms King63e4dbd2016-03-04 10:45:44 -0800103
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100104re2_test(
105 "compile_test",
106 size = "small",
107)
Shahms King63e4dbd2016-03-04 10:45:44 -0800108
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100109re2_test(
110 "filtered_re2_test",
111 size = "small",
112)
Shahms King63e4dbd2016-03-04 10:45:44 -0800113
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100114re2_test(
115 "mimics_pcre_test",
116 size = "small",
117)
Shahms King63e4dbd2016-03-04 10:45:44 -0800118
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100119re2_test(
120 "parse_test",
121 size = "small",
122)
Shahms King63e4dbd2016-03-04 10:45:44 -0800123
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100124re2_test(
125 "possible_match_test",
126 size = "small",
127)
Shahms King63e4dbd2016-03-04 10:45:44 -0800128
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100129re2_test(
130 "re2_arg_test",
131 size = "small",
132)
Shahms King63e4dbd2016-03-04 10:45:44 -0800133
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100134re2_test(
135 "re2_test",
136 size = "small",
137)
Shahms King63e4dbd2016-03-04 10:45:44 -0800138
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100139re2_test(
140 "regexp_test",
141 size = "small",
142)
Shahms King63e4dbd2016-03-04 10:45:44 -0800143
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100144re2_test(
145 "required_prefix_test",
146 size = "small",
147)
Shahms King63e4dbd2016-03-04 10:45:44 -0800148
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100149re2_test(
150 "search_test",
151 size = "small",
152)
Shahms King63e4dbd2016-03-04 10:45:44 -0800153
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100154re2_test(
155 "set_test",
156 size = "small",
157)
Shahms King63e4dbd2016-03-04 10:45:44 -0800158
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100159re2_test(
160 "simplify_test",
161 size = "small",
162)
Shahms King63e4dbd2016-03-04 10:45:44 -0800163
Paul Wankadia5ca216d2017-10-11 21:33:59 +1100164re2_test(
165 "string_generator_test",
166 size = "small",
167)
Ming Zhaodd223322015-04-21 11:41:18 -0700168
Shahms King63e4dbd2016-03-04 10:45:44 -0800169re2_test(
170 "dfa_test",
171 size = "large",
172)
173
174re2_test(
175 "exhaustive1_test",
176 size = "large",
177)
178
179re2_test(
180 "exhaustive2_test",
181 size = "large",
182)
183
184re2_test(
185 "exhaustive3_test",
186 size = "large",
187)
188
189re2_test(
190 "exhaustive_test",
191 size = "large",
192)
193
194re2_test(
195 "random_test",
196 size = "large",
197)
Paul Wankadiaf3a95882015-09-26 03:21:18 +1000198
Thiago Farina5f4c8552016-04-12 08:22:52 -0300199cc_library(
200 name = "benchmark",
Damien Martin-Guillerezfc5ff3b2016-10-20 11:52:13 +0200201 testonly = 1,
Paul Wankadiab12a3242016-04-14 14:34:20 +1000202 srcs = ["util/benchmark.cc"],
Thiago Farina5f4c8552016-04-12 08:22:52 -0300203 deps = [":testing"],
204)
205
206cc_binary(
207 name = "regexp_benchmark",
Damien Martin-Guillerezfc5ff3b2016-10-20 11:52:13 +0200208 testonly = 1,
Paul Wankadiab12a3242016-04-14 14:34:20 +1000209 srcs = ["re2/testing/regexp_benchmark.cc"],
Thiago Farina5f4c8552016-04-12 08:22:52 -0300210 linkopts = [
Thiago Farina5f4c8552016-04-12 08:22:52 -0300211 "-lm",
Paul Wankadiab12a3242016-04-14 14:34:20 +1000212 "-lrt",
Thiago Farina5f4c8552016-04-12 08:22:52 -0300213 ],
214 deps = [":benchmark"],
215)