blob: 5223f6eed4f7c1e78781ad6cfcaa0b1111b9e87e [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
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",
Damien Martin-Guillerezfc5ff3b2016-10-20 11:52:13 +0200159 testonly = 1,
Paul Wankadiab12a3242016-04-14 14:34:20 +1000160 srcs = ["util/benchmark.cc"],
Thiago Farina5f4c8552016-04-12 08:22:52 -0300161 deps = [":testing"],
162)
163
164cc_binary(
165 name = "regexp_benchmark",
Damien Martin-Guillerezfc5ff3b2016-10-20 11:52:13 +0200166 testonly = 1,
Paul Wankadiab12a3242016-04-14 14:34:20 +1000167 srcs = ["re2/testing/regexp_benchmark.cc"],
Thiago Farina5f4c8552016-04-12 08:22:52 -0300168 linkopts = [
Thiago Farina5f4c8552016-04-12 08:22:52 -0300169 "-lm",
Paul Wankadiab12a3242016-04-14 14:34:20 +1000170 "-lrt",
Thiago Farina5f4c8552016-04-12 08:22:52 -0300171 ],
172 deps = [":benchmark"],
173)