• 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        "csv.cc",
41        "detokenize.cc",
42        "decode.cc",
43    ],
44    static_libs: [
45        "pw_base64",
46        "pw_bytes",
47        "pw_containers",
48        "pw_elf_reader",
49        "pw_log_tokenized",
50        "pw_polyfill",
51        "pw_preprocessor",
52        "pw_result",
53        "pw_span",
54        "pw_stream",
55        "pw_varint",
56    ],
57    export_static_lib_headers: [
58        "pw_base64",
59        "pw_bytes",
60        "pw_containers",
61        "pw_elf_reader",
62        "pw_polyfill",
63        "pw_preprocessor",
64        "pw_result",
65        "pw_span",
66        "pw_stream",
67        "pw_varint",
68    ],
69}
70
71cc_library_static {
72    name: "pw_tokenizer",
73    cpp_std: "c++20",
74    host_supported: true,
75    vendor_available: true,
76    export_include_dirs: ["public"],
77    defaults: [
78        "pw_android_common_backends",
79    ],
80    srcs: [
81        "encode_args.cc",
82        "hash.cc",
83        "tokenize.cc",
84    ],
85    header_libs: [
86        "pw_assert",
87        "pw_log",
88    ],
89    export_header_lib_headers: [
90        "pw_assert",
91        "pw_log",
92    ],
93    static_libs: [
94        "pw_containers",
95        "pw_log_tokenized",
96        "pw_polyfill",
97        "pw_preprocessor",
98        "pw_span",
99        "pw_varint",
100    ],
101    export_static_lib_headers: [
102        "pw_containers",
103        "pw_log_tokenized",
104        "pw_polyfill",
105        "pw_preprocessor",
106        "pw_span",
107        "pw_varint",
108    ],
109}
110
111cc_library_static {
112    name: "pw_tokenizer_base64",
113    cpp_std: "c++20",
114    host_supported: true,
115    vendor_available: true,
116    export_include_dirs: ["public"],
117    defaults: [
118        "pw_android_common_backends",
119    ],
120    srcs: [
121        "base64.cc",
122    ],
123    static_libs: [
124        "pw_base64",
125        "pw_containers",
126        "pw_preprocessor",
127        "pw_span",
128        "pw_string",
129        "pw_tokenizer",
130    ],
131    export_static_lib_headers: [
132        "pw_base64",
133        "pw_containers",
134        "pw_preprocessor",
135        "pw_span",
136        "pw_string",
137        "pw_tokenizer",
138    ],
139}
140
141cc_library_headers {
142    name: "pw_tokenizer_pwpb",
143    cpp_std: "c++20",
144    vendor_available: true,
145    host_supported: true,
146    generated_headers: [
147        "google_protobuf_descriptor_pwpb_h",
148        "pw_tokenizer_proto_options_pwpb_h",
149    ],
150    export_generated_headers: [
151        "google_protobuf_descriptor_pwpb_h",
152        "pw_tokenizer_proto_options_pwpb_h",
153    ],
154}
155
156// Expose pw_tokenizer_proto/options.proto.
157filegroup {
158    name: "pw_tokenizer_proto_options_proto",
159    srcs: [
160        "pw_tokenizer_proto/options.proto",
161    ],
162}
163
164genrule {
165    name: "pw_tokenizer_proto_options_pwpb_h",
166    srcs: [
167        ":libprotobuf-internal-protos",
168        "pw_tokenizer_proto/options.proto",
169    ],
170    cmd: "python3 $(location pw_protobuf_compiler_py) " +
171        "--proto-path=external/pigweed/pw_tokenizer/ " +
172        "--proto-path=external/protobuf/src/ " +
173        "--out-dir=$$(dirname $(location pw_tokenizer_proto/options.pwpb.h)) " +
174        "--plugin-path=$(location pw_protobuf_plugin_py) " +
175        "--compile-dir=$$(dirname $(location pw_tokenizer_proto/options.proto)) " +
176        "--sources $(location pw_tokenizer_proto/options.proto) " +
177        "--language pwpb " +
178        "--no-experimental-proto3-optional " +
179        "--no-experimental-editions " +
180        "--pwpb-no-oneof-callbacks " +
181        "--protoc=$(location aprotoc) ",
182    out: [
183        "pw_tokenizer_proto/options.pwpb.h",
184    ],
185    tools: [
186        "aprotoc",
187        "pw_protobuf_plugin_py",
188        "pw_protobuf_compiler_py",
189    ],
190}
191