blob: b5a567d24cfbd312a326bdc0a5930c2b456c8832 [file] [log] [blame]
Ming Zhaodd223322015-04-21 11:41:18 -07001# Bazel(http://bazel.io/) build file
2
3licenses(["notice"])
4
5# Make stringpiece a standalone lib so it can be used without polling
6# other parts of re2.
7cc_library(
8 name = "stringpiece",
9 visibility = ["//visibility:public"],
10 hdrs = [
11 "re2/stringpiece.h",
12 ],
13 srcs = [
14 "re2/stringpiece.cc",
15 ],
16 includes = [
17 "."
18 ]
19)
20
21cc_library(
22 name = "re2",
23 visibility = ["//visibility:public"],
24 hdrs = [
25 "re2/filtered_re2.h",
26 "re2/re2.h",
27 "re2/set.h",
28 "re2/variadic_function.h",
29 ],
30 deps = [
31 ":stringpiece",
32 ],
33 includes = [
34 ".",
35 ],
36 srcs = [
37 # Internal headers
38 "re2/prefilter.h",
39 "re2/prefilter_tree.h",
40 "re2/prog.h",
41 "re2/regexp.h",
42 "re2/unicode_casefold.h",
43 "re2/unicode_groups.h",
44 "re2/walker-inl.h",
45 "util/atomicops.h",
46 "util/flags.h",
47 "util/logging.h",
48 "util/mutex.h",
49 "util/sparse_array.h",
50 "util/sparse_set.h",
51 "util/utf.h",
52 "util/util.h",
53 "util/valgrind.h",
54 "re2/bitstate.cc",
55 "re2/compile.cc",
56 "re2/dfa.cc",
57 "re2/filtered_re2.cc",
58 "re2/mimics_pcre.cc",
59 "re2/nfa.cc",
60 "re2/onepass.cc",
61 "re2/parse.cc",
62 "re2/perl_groups.cc",
63 "re2/prefilter.cc",
64 "re2/prefilter_tree.cc",
65 "re2/prog.cc",
66 "re2/re2.cc",
67 "re2/regexp.cc",
68 "re2/set.cc",
69 "re2/simplify.cc",
70 "re2/tostring.cc",
71 "re2/unicode_casefold.cc",
72 "re2/unicode_groups.cc",
73 "util/hash.cc",
74 "util/rune.cc",
75 "util/stringprintf.cc",
76 "util/strutil.cc",
77 "util/valgrind.cc",
78 ],
79 linkopts = [
80 "-pthread"
81 ]
82)
83
84# Test-only libraries
85cc_library(
86 name="test",
87 hdrs = [
88 "re2/testing/regexp_generator.h",
89 "re2/testing/string_generator.h",
90 "re2/testing/tester.h",
91 "util/pcre.h",
92 "util/random.h",
93 "util/test.h",
94 ],
95 srcs = [
96 "re2/testing/backtrack.cc",
97 "re2/testing/dump.cc",
98 "re2/testing/regexp_generator.cc",
99 "re2/testing/string_generator.cc",
100 "re2/testing/tester.cc",
101 "util/pcre.cc",
102 "util/random.cc",
103 "util/test.cc",
104 ],
105 testonly = 1,
106 deps = [
107 ":re2",
108 ],
109)
110
111load("re2_test", "re2_test")
112
113re2_test("charclass_test")
114re2_test("compile_test")
115re2_test("filtered_re2_test")
116re2_test("mimics_pcre_test")
117re2_test("parse_test")
118re2_test("possible_match_test")
119re2_test("re2_test")
120re2_test("re2_arg_test")
121re2_test("regexp_test")
122re2_test("required_prefix_test")
123re2_test("search_test")
124re2_test("set_test")
125re2_test("simplify_test")
126re2_test("string_generator_test")
127
128# TODO: support "big" tests as per Makefile, these libraries should be
129# compiled too: util/thread.{cc,h} for dfa_test. Oh, and
130# re2/testing/exhaustive_tester.{cc,h} for the exhaustive tests.