blob: 1a8aecbd2c9e14dc29bf63bb8856f4098a095100 [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 Wankadia7e482002015-10-24 12:17:07 +110043 "util/logging.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100044 "util/logging.h",
Paul Wankadia1e8fade2016-08-16 22:27:03 +100045 "util/mix.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100046 "util/mutex.h",
47 "util/rune.cc",
48 "util/sparse_array.h",
49 "util/sparse_set.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100050 "util/strutil.cc",
Paul Wankadia95ce0cc2016-08-16 23:11:37 +100051 "util/strutil.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100052 "util/utf.h",
53 "util/util.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100054 ],
55 hdrs = [
56 "re2/filtered_re2.h",
57 "re2/re2.h",
58 "re2/set.h",
Paul Wankadia791beff2015-11-17 00:15:44 +110059 "re2/stringpiece.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100060 ],
Paul Wankadia46d730b2016-01-03 17:38:22 +110061 copts = ["-pthread"],
Paul Wankadiaa96b4642015-04-27 20:29:47 +100062 linkopts = ["-pthread"],
63 visibility = ["//visibility:public"],
Ming Zhaodd223322015-04-21 11:41:18 -070064)
65
Ming Zhaodd223322015-04-21 11:41:18 -070066cc_library(
Thiago Farina5f4c8552016-04-12 08:22:52 -030067 name = "testing",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100068 testonly = 1,
69 srcs = [
70 "re2/testing/backtrack.cc",
71 "re2/testing/dump.cc",
Paul Wankadiaf3a95882015-09-26 03:21:18 +100072 "re2/testing/exhaustive_tester.cc",
73 "re2/testing/null_walker.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100074 "re2/testing/regexp_generator.cc",
75 "re2/testing/string_generator.cc",
76 "re2/testing/tester.cc",
77 "util/pcre.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100078 ],
79 hdrs = [
Paul Wankadiaf3a95882015-09-26 03:21:18 +100080 "re2/testing/exhaustive_tester.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100081 "re2/testing/regexp_generator.h",
82 "re2/testing/string_generator.h",
83 "re2/testing/tester.h",
Paul Wankadiab12a3242016-04-14 14:34:20 +100084 "util/benchmark.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100085 "util/pcre.h",
Damien Martin-Guillerez5968df02016-03-31 17:35:34 +020086 "util/test.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100087 ],
Paul Wankadia791beff2015-11-17 00:15:44 +110088 deps = [":re2"],
Ming Zhaodd223322015-04-21 11:41:18 -070089)
90
Thiago Farina5f4c8552016-04-12 08:22:52 -030091cc_library(
92 name = "test",
Paul Wankadiab12a3242016-04-14 14:34:20 +100093 srcs = ["util/test.cc"],
Thiago Farina5f4c8552016-04-12 08:22:52 -030094 deps = [":testing"],
95)
96
Ming Zhaodd223322015-04-21 11:41:18 -070097load("re2_test", "re2_test")
98
99re2_test("charclass_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800100
Ming Zhaodd223322015-04-21 11:41:18 -0700101re2_test("compile_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800102
Ming Zhaodd223322015-04-21 11:41:18 -0700103re2_test("filtered_re2_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800104
Ming Zhaodd223322015-04-21 11:41:18 -0700105re2_test("mimics_pcre_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800106
Ming Zhaodd223322015-04-21 11:41:18 -0700107re2_test("parse_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800108
Ming Zhaodd223322015-04-21 11:41:18 -0700109re2_test("possible_match_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800110
Ming Zhaodd223322015-04-21 11:41:18 -0700111re2_test("re2_arg_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800112
Paul Wankadia1add8042016-02-09 20:37:03 +1100113re2_test("re2_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800114
Ming Zhaodd223322015-04-21 11:41:18 -0700115re2_test("regexp_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800116
Ming Zhaodd223322015-04-21 11:41:18 -0700117re2_test("required_prefix_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800118
Ming Zhaodd223322015-04-21 11:41:18 -0700119re2_test("search_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800120
Ming Zhaodd223322015-04-21 11:41:18 -0700121re2_test("set_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800122
Ming Zhaodd223322015-04-21 11:41:18 -0700123re2_test("simplify_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800124
Ming Zhaodd223322015-04-21 11:41:18 -0700125re2_test("string_generator_test")
126
Shahms King63e4dbd2016-03-04 10:45:44 -0800127re2_test(
128 "dfa_test",
129 size = "large",
130)
131
132re2_test(
133 "exhaustive1_test",
134 size = "large",
135)
136
137re2_test(
138 "exhaustive2_test",
139 size = "large",
140)
141
142re2_test(
143 "exhaustive3_test",
144 size = "large",
145)
146
147re2_test(
148 "exhaustive_test",
149 size = "large",
150)
151
152re2_test(
153 "random_test",
154 size = "large",
155)
Paul Wankadiaf3a95882015-09-26 03:21:18 +1000156
Thiago Farina5f4c8552016-04-12 08:22:52 -0300157cc_library(
158 name = "benchmark",
Paul Wankadiab12a3242016-04-14 14:34:20 +1000159 srcs = ["util/benchmark.cc"],
Thiago Farina5f4c8552016-04-12 08:22:52 -0300160 deps = [":testing"],
161)
162
163cc_binary(
164 name = "regexp_benchmark",
Paul Wankadiab12a3242016-04-14 14:34:20 +1000165 srcs = ["re2/testing/regexp_benchmark.cc"],
Thiago Farina5f4c8552016-04-12 08:22:52 -0300166 linkopts = [
Thiago Farina5f4c8552016-04-12 08:22:52 -0300167 "-lm",
Paul Wankadiab12a3242016-04-14 14:34:20 +1000168 "-lrt",
Thiago Farina5f4c8552016-04-12 08:22:52 -0300169 ],
170 deps = [":benchmark"],
171)