blob: 3aebcec4ee4057e1212d0f6708c6817c94f554e1 [file] [log] [blame]
Paul Wankadiaa96b4642015-04-27 20:29:47 +10001# Bazel (http://bazel.io/) BUILD file for RE2.
Ming Zhaodd223322015-04-21 11:41:18 -07002
3licenses(["notice"])
4
Paul Wankadiaa96b4642015-04-27 20:29:47 +10005# stringpiece is a standalone library so that it can be used without pulling in
6# all of the other parts of RE2.
Ming Zhaodd223322015-04-21 11:41:18 -07007cc_library(
Paul Wankadiaa96b4642015-04-27 20:29:47 +10008 name = "stringpiece",
9 srcs = ["re2/stringpiece.cc"],
10 hdrs = ["re2/stringpiece.h"],
11 includes = ["."],
12 visibility = ["//visibility:public"],
Ming Zhaodd223322015-04-21 11:41:18 -070013)
14
15cc_library(
Paul Wankadiaa96b4642015-04-27 20:29:47 +100016 name = "re2",
17 srcs = [
18 "re2/bitstate.cc",
19 "re2/compile.cc",
20 "re2/dfa.cc",
21 "re2/filtered_re2.cc",
22 "re2/mimics_pcre.cc",
23 "re2/nfa.cc",
24 "re2/onepass.cc",
25 "re2/parse.cc",
26 "re2/perl_groups.cc",
27 "re2/prefilter.cc",
28 "re2/prefilter.h",
29 "re2/prefilter_tree.cc",
30 "re2/prefilter_tree.h",
31 "re2/prog.cc",
32 "re2/prog.h",
33 "re2/re2.cc",
34 "re2/regexp.cc",
35 "re2/regexp.h",
36 "re2/set.cc",
37 "re2/simplify.cc",
38 "re2/tostring.cc",
39 "re2/unicode_casefold.cc",
40 "re2/unicode_casefold.h",
41 "re2/unicode_groups.cc",
42 "re2/unicode_groups.h",
43 "re2/walker-inl.h",
44 "util/atomicops.h",
45 "util/flags.h",
46 "util/hash.cc",
47 "util/logging.h",
48 "util/mutex.h",
49 "util/rune.cc",
50 "util/sparse_array.h",
51 "util/sparse_set.h",
52 "util/stringprintf.cc",
53 "util/strutil.cc",
54 "util/utf.h",
55 "util/util.h",
56 "util/valgrind.cc",
57 "util/valgrind.h",
58 ],
59 hdrs = [
60 "re2/filtered_re2.h",
61 "re2/re2.h",
62 "re2/set.h",
63 "re2/variadic_function.h",
64 ],
65 includes = ["."],
66 linkopts = ["-pthread"],
67 visibility = ["//visibility:public"],
68 deps = [
69 ":stringpiece",
70 ],
Ming Zhaodd223322015-04-21 11:41:18 -070071)
72
Ming Zhaodd223322015-04-21 11:41:18 -070073cc_library(
Paul Wankadiaa96b4642015-04-27 20:29:47 +100074 name = "test",
75 testonly = 1,
76 srcs = [
77 "re2/testing/backtrack.cc",
78 "re2/testing/dump.cc",
79 "re2/testing/regexp_generator.cc",
80 "re2/testing/string_generator.cc",
81 "re2/testing/tester.cc",
82 "util/pcre.cc",
83 "util/random.cc",
84 "util/test.cc",
85 ],
86 hdrs = [
87 "re2/testing/regexp_generator.h",
88 "re2/testing/string_generator.h",
89 "re2/testing/tester.h",
90 "util/pcre.h",
91 "util/random.h",
92 "util/test.h",
93 ],
94 includes = ["."],
95 deps = [
96 ":re2",
97 ],
Ming Zhaodd223322015-04-21 11:41:18 -070098)
99
100load("re2_test", "re2_test")
101
102re2_test("charclass_test")
103re2_test("compile_test")
104re2_test("filtered_re2_test")
105re2_test("mimics_pcre_test")
106re2_test("parse_test")
107re2_test("possible_match_test")
108re2_test("re2_test")
109re2_test("re2_arg_test")
110re2_test("regexp_test")
111re2_test("required_prefix_test")
112re2_test("search_test")
113re2_test("set_test")
114re2_test("simplify_test")
115re2_test("string_generator_test")
116
Paul Wankadiaa96b4642015-04-27 20:29:47 +1000117# TODO: Add the "big" tests from the Makefile.
118# util/thread.{cc,h} will be needed for the DFA test.
119# re2/testing/exhaustive_tester.{cc,h} will be needed for the exhaustive tests.