• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2022 The Pigweed Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4// use this file except in compliance with the License. You may obtain a copy of
5// the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12// License for the specific language governing permissions and limitations under
13// the License.
14
15package {
16    default_applicable_licenses: ["external_pigweed_license"],
17}
18
19cc_library_static {
20    name: "pw_detokenizer",
21    cpp_std: "c++20",
22    vendor_available: true,
23    host_supported: true,
24    export_include_dirs: ["public"],
25    defaults: [
26        "pw_android_common_backends",
27    ],
28    header_libs: [
29        "fuchsia_sdk_lib_stdcompat",
30        "pw_assert",
31        "pw_log",
32    ],
33    export_header_lib_headers: [
34        "fuchsia_sdk_lib_stdcompat",
35        "pw_assert",
36        "pw_log",
37    ],
38    srcs: [
39        "base64.cc",
40        "detokenize.cc",
41        "decode.cc",
42    ],
43    static_libs: [
44        "pw_base64",
45        "pw_bytes",
46        "pw_containers",
47        "pw_log_tokenized",
48        "pw_polyfill",
49        "pw_preprocessor",
50        "pw_result",
51        "pw_span",
52        "pw_varint",
53    ],
54    export_static_lib_headers: [
55        "pw_base64",
56        "pw_bytes",
57        "pw_containers",
58        "pw_polyfill",
59        "pw_preprocessor",
60        "pw_result",
61        "pw_span",
62        "pw_varint",
63    ],
64}
65
66cc_library_static {
67    name: "pw_tokenizer",
68    cpp_std: "c++20",
69    host_supported: true,
70    vendor_available: true,
71    export_include_dirs: ["public"],
72    defaults: [
73        "pw_android_common_backends",
74    ],
75    srcs: [
76        "encode_args.cc",
77        "hash.cc",
78        "tokenize.cc",
79    ],
80    header_libs: [
81        "pw_assert",
82        "pw_log",
83    ],
84    export_header_lib_headers: [
85        "pw_assert",
86        "pw_log",
87    ],
88    static_libs: [
89        "pw_containers",
90        "pw_log_tokenized",
91        "pw_polyfill",
92        "pw_preprocessor",
93        "pw_span",
94        "pw_varint",
95    ],
96    export_static_lib_headers: [
97        "pw_containers",
98        "pw_log_tokenized",
99        "pw_polyfill",
100        "pw_preprocessor",
101        "pw_span",
102        "pw_varint",
103    ],
104}
105
106cc_library_static {
107    name: "pw_tokenizer_base64",
108    cpp_std: "c++20",
109    host_supported: true,
110    vendor_available: true,
111    export_include_dirs: ["public"],
112    defaults: [
113        "pw_android_common_backends",
114    ],
115    srcs: [
116        "base64.cc",
117    ],
118    static_libs: [
119        "pw_base64",
120        "pw_containers",
121        "pw_preprocessor",
122        "pw_span",
123        "pw_string",
124        "pw_tokenizer",
125    ],
126    export_static_lib_headers: [
127        "pw_base64",
128        "pw_containers",
129        "pw_preprocessor",
130        "pw_span",
131        "pw_string",
132        "pw_tokenizer",
133    ],
134}
135
136cc_library_headers {
137    name: "pw_tokenizer_pwpb",
138    cpp_std: "c++20",
139    vendor_available: true,
140    host_supported: true,
141    generated_headers: [
142        "google_protobuf_descriptor_pwpb_h",
143        "pw_tokenizer_proto_options_pwpb_h",
144    ],
145    export_generated_headers: [
146        "google_protobuf_descriptor_pwpb_h",
147        "pw_tokenizer_proto_options_pwpb_h",
148    ],
149}
150
151// Expose pw_tokenizer_proto/options.proto.
152filegroup {
153    name: "pw_tokenizer_proto_options_proto",
154    srcs: [
155        "pw_tokenizer_proto/options.proto",
156    ],
157}
158
159genrule {
160    name: "pw_tokenizer_proto_options_pwpb_h",
161    srcs: [
162        ":libprotobuf-internal-protos",
163        "pw_tokenizer_proto/options.proto",
164    ],
165    cmd: "python3 $(location pw_protobuf_compiler_py) " +
166        "--proto-path=external/pigweed/pw_tokenizer/ " +
167        "--proto-path=external/protobuf/src/ " +
168        "--out-dir=$$(dirname $(location pw_tokenizer_proto/options.pwpb.h)) " +
169        "--plugin-path=$(location pw_protobuf_plugin_py) " +
170        "--compile-dir=$$(dirname $(location pw_tokenizer_proto/options.proto)) " +
171        "--sources $(location pw_tokenizer_proto/options.proto) " +
172        "--language pwpb " +
173        "--no-experimental-proto3-optional " +
174        "--protoc=$(location aprotoc) ",
175    out: [
176        "pw_tokenizer_proto/options.pwpb.h",
177    ],
178    tools: [
179        "aprotoc",
180        "pw_protobuf_plugin_py",
181        "pw_protobuf_compiler_py",
182    ],
183}
184