blob: ccf991667f0720902311f8f3cd81a6d80353a1a7 [file] [log] [blame]
Dan Willemsen66926142016-07-19 19:34:54 -07001
Janis Danisevskis53e448c2016-03-31 13:35:25 +01002
3libpcre2_dist_prefix = "dist2"
4
5libpcre2_src_files = [
6 libpcre2_dist_prefix + "/src/pcre2_auto_possess.c",
7 libpcre2_dist_prefix + "/src/pcre2_compile.c",
8 libpcre2_dist_prefix + "/src/pcre2_config.c",
9 libpcre2_dist_prefix + "/src/pcre2_context.c",
10 libpcre2_dist_prefix + "/src/pcre2_dfa_match.c",
11 libpcre2_dist_prefix + "/src/pcre2_error.c",
12 libpcre2_dist_prefix + "/src/pcre2_find_bracket.c",
13 libpcre2_dist_prefix + "/src/pcre2_maketables.c",
14 libpcre2_dist_prefix + "/src/pcre2_match.c",
15 libpcre2_dist_prefix + "/src/pcre2_match_data.c",
16 libpcre2_dist_prefix + "/src/pcre2_jit_compile.c",
17 libpcre2_dist_prefix + "/src/pcre2_newline.c",
18 libpcre2_dist_prefix + "/src/pcre2_ord2utf.c",
19 libpcre2_dist_prefix + "/src/pcre2_pattern_info.c",
20 libpcre2_dist_prefix + "/src/pcre2_serialize.c",
21 libpcre2_dist_prefix + "/src/pcre2_string_utils.c",
22 libpcre2_dist_prefix + "/src/pcre2_study.c",
23 libpcre2_dist_prefix + "/src/pcre2_substitute.c",
24 libpcre2_dist_prefix + "/src/pcre2_substring.c",
25 libpcre2_dist_prefix + "/src/pcre2_tables.c",
26 libpcre2_dist_prefix + "/src/pcre2_ucd.c",
27 libpcre2_dist_prefix + "/src/pcre2_valid_utf.c",
28 libpcre2_dist_prefix + "/src/pcre2_xclass.c",
29 libpcre2_dist_prefix + "/src/pcre2_chartables.c",
30]
31
Dan Willemsen66926142016-07-19 19:34:54 -070032cc_defaults {
33 name: "pcre_defaults",
Chih-Hung Hsieh65945542017-09-28 15:39:31 -070034 cflags: [
35 "-DHAVE_CONFIG_H",
36 "-Wall",
37 "-Werror",
38 ],
Chih-Hung Hsieh48eadb42017-08-09 15:30:45 -070039 tidy_checks: [
40 "-google-build-using-namespace",
41 "-google-global-names-in-headers",
42 ],
Janis Danisevskis53e448c2016-03-31 13:35:25 +010043 local_include_dirs: [
44 "include_internal",
45 "include",
Dan Willemsen66926142016-07-19 19:34:54 -070046 ],
Janis Danisevskis53e448c2016-03-31 13:35:25 +010047 export_include_dirs: ["include"],
Dan Willemsen66926142016-07-19 19:34:54 -070048}
49
Elliott Hughesf22fc772018-04-23 16:54:02 -070050//
51// libpcre2
52//
Dan Willemsen66926142016-07-19 19:34:54 -070053
54cc_library {
Janis Danisevskis53e448c2016-03-31 13:35:25 +010055 name: "libpcre2",
Dan Willemsen66926142016-07-19 19:34:54 -070056 defaults: ["pcre_defaults"],
57 host_supported: true,
Vijay Venkatramanf60d8432017-04-18 15:54:40 -070058 vendor_available: true,
Justin Yuncc36a0a2017-07-24 15:19:44 +090059 vndk: {
60 enabled: true,
61 },
Janis Danisevskis53e448c2016-03-31 13:35:25 +010062 srcs: libpcre2_src_files,
Dan Willemsen38109c92017-03-15 14:38:37 -070063 target: {
64 linux_bionic: {
65 enabled: true,
66 },
67 },
Dan Willemsen66926142016-07-19 19:34:54 -070068}
69
Elliott Hughesf22fc772018-04-23 16:54:02 -070070//
71// PCRE grep
72//
73
74cc_defaults {
75 name: "grep_common",
76 defaults: ["pcre_defaults"],
77 srcs: [libpcre2_dist_prefix + "/src/pcre2grep.c"],
78 shared_libs: ["libpcre2"],
79}
80
81cc_binary {
82 name: "grep",
83 defaults: ["grep_common"],
84}
85
86cc_binary {
87 name: "grep_vendor",
88 defaults: ["grep_common"],
89 stem: "grep",
90 vendor: true,
91}
92
93//
94// Google's C++ wrapper.
95//
Dan Willemsen66926142016-07-19 19:34:54 -070096
Janis Danisevskis4c7d77a2016-04-01 12:25:25 +010097cc_library_shared {
98 name: "libpcrecpp",
Chih-Hung Hsieh65945542017-09-28 15:39:31 -070099 cflags: [
100 "-Wall",
101 "-Werror",
102 "-Wno-unused-parameter",
103 "-Wno-unused-variable",
104 ],
Chih-Hung Hsieh48eadb42017-08-09 15:30:45 -0700105 tidy_checks: [
106 "-google-build-using-namespace",
107 "-google-global-names-in-headers",
108 ],
Janis Danisevskis4c7d77a2016-04-01 12:25:25 +0100109 local_include_dirs: ["pcrecpp/include"],
110 shared_libs: ["libpcre2"],
111 export_include_dirs: [
112 "pcrecpp/include",
113 "include",
114 ],
115 srcs: [
116 "pcrecpp/pcrecpp.cc",
117 "pcrecpp/pcre_scanner.cc",
118 "pcrecpp/pcre_stringpiece.cc",
119 ],
120}