blob: 6be8c288710450c02e93723c4af364bd5a5ce667 [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
Ming Zhaodd223322015-04-21 11:41:18 -07009cc_library(
Paul Wankadiaa96b4642015-04-27 20:29:47 +100010 name = "re2",
11 srcs = [
12 "re2/bitstate.cc",
13 "re2/compile.cc",
14 "re2/dfa.cc",
15 "re2/filtered_re2.cc",
16 "re2/mimics_pcre.cc",
17 "re2/nfa.cc",
18 "re2/onepass.cc",
19 "re2/parse.cc",
20 "re2/perl_groups.cc",
21 "re2/prefilter.cc",
22 "re2/prefilter.h",
23 "re2/prefilter_tree.cc",
24 "re2/prefilter_tree.h",
25 "re2/prog.cc",
26 "re2/prog.h",
27 "re2/re2.cc",
28 "re2/regexp.cc",
29 "re2/regexp.h",
30 "re2/set.cc",
31 "re2/simplify.cc",
Paul Wankadia791beff2015-11-17 00:15:44 +110032 "re2/stringpiece.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100033 "re2/tostring.cc",
34 "re2/unicode_casefold.cc",
35 "re2/unicode_casefold.h",
36 "re2/unicode_groups.cc",
37 "re2/unicode_groups.h",
38 "re2/walker-inl.h",
39 "util/atomicops.h",
40 "util/flags.h",
41 "util/hash.cc",
Paul Wankadia7e482002015-10-24 12:17:07 +110042 "util/logging.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100043 "util/logging.h",
44 "util/mutex.h",
45 "util/rune.cc",
46 "util/sparse_array.h",
47 "util/sparse_set.h",
48 "util/stringprintf.cc",
49 "util/strutil.cc",
50 "util/utf.h",
51 "util/util.h",
52 "util/valgrind.cc",
53 "util/valgrind.h",
54 ],
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 "re2/variadic_function.h",
61 ],
Paul Wankadia46d730b2016-01-03 17:38:22 +110062 copts = ["-pthread"],
Paul Wankadiaa96b4642015-04-27 20:29:47 +100063 includes = ["."],
64 linkopts = ["-pthread"],
65 visibility = ["//visibility:public"],
Ming Zhaodd223322015-04-21 11:41:18 -070066)
67
Ming Zhaodd223322015-04-21 11:41:18 -070068cc_library(
Paul Wankadiaa96b4642015-04-27 20:29:47 +100069 name = "test",
70 testonly = 1,
71 srcs = [
72 "re2/testing/backtrack.cc",
73 "re2/testing/dump.cc",
Paul Wankadiaf3a95882015-09-26 03:21:18 +100074 "re2/testing/exhaustive_tester.cc",
75 "re2/testing/null_walker.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100076 "re2/testing/regexp_generator.cc",
77 "re2/testing/string_generator.cc",
78 "re2/testing/tester.cc",
79 "util/pcre.cc",
80 "util/random.cc",
81 "util/test.cc",
Paul Wankadiaf3a95882015-09-26 03:21:18 +100082 "util/thread.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100083 ],
84 hdrs = [
Paul Wankadiaf3a95882015-09-26 03:21:18 +100085 "re2/testing/exhaustive_tester.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100086 "re2/testing/regexp_generator.h",
87 "re2/testing/string_generator.h",
88 "re2/testing/tester.h",
89 "util/pcre.h",
90 "util/random.h",
91 "util/test.h",
Paul Wankadiaf3a95882015-09-26 03:21:18 +100092 "util/thread.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100093 ],
94 includes = ["."],
Paul Wankadia791beff2015-11-17 00:15:44 +110095 deps = [":re2"],
Ming Zhaodd223322015-04-21 11:41:18 -070096)
97
98load("re2_test", "re2_test")
99
100re2_test("charclass_test")
101re2_test("compile_test")
102re2_test("filtered_re2_test")
103re2_test("mimics_pcre_test")
104re2_test("parse_test")
105re2_test("possible_match_test")
Ming Zhaodd223322015-04-21 11:41:18 -0700106re2_test("re2_arg_test")
Paul Wankadia1add8042016-02-09 20:37:03 +1100107re2_test("re2_test")
Ming Zhaodd223322015-04-21 11:41:18 -0700108re2_test("regexp_test")
109re2_test("required_prefix_test")
110re2_test("search_test")
111re2_test("set_test")
112re2_test("simplify_test")
113re2_test("string_generator_test")
114
Paul Wankadia1add8042016-02-09 20:37:03 +1100115re2_test("dfa_test", size="large")
116re2_test("exhaustive1_test", size="large")
117re2_test("exhaustive2_test", size="large")
118re2_test("exhaustive3_test", size="large")
119re2_test("exhaustive_test", size="large")
Damien Martin-Guillerez22a07e62016-01-13 17:28:26 +0100120re2_test("random_test", size="large")
Paul Wankadiaf3a95882015-09-26 03:21:18 +1000121
122# TODO: Add support for regexp_benchmark.