1 # Copyright 2020 The Pigweed Authors
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
7 # https://www.apache.org/licenses/LICENSE-2.0
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
16 "//pw_build:pigweed.bzl",
22 package(default_visibility = ["//visibility:public"])
24 licenses(["notice"]) # Apache License 2.0
27 name = "pw_tokenizer",
31 "public/pw_tokenizer/config.h",
32 "public/pw_tokenizer/internal/argument_types.h",
33 "public/pw_tokenizer/internal/argument_types_macro_4_byte.h",
34 "public/pw_tokenizer/internal/argument_types_macro_8_byte.h",
35 "public/pw_tokenizer/internal/pw_tokenizer_65599_fixed_length_128_hash_macro.h",
36 "public/pw_tokenizer/internal/pw_tokenizer_65599_fixed_length_80_hash_macro.h",
37 "public/pw_tokenizer/internal/pw_tokenizer_65599_fixed_length_96_hash_macro.h",
38 "public/pw_tokenizer/internal/tokenize_string.h",
39 "pw_tokenizer_private/encode_args.h",
43 "public/pw_tokenizer/hash.h",
44 "public/pw_tokenizer/tokenize.h",
46 includes = ["public"],
55 # TODO(pwbug/101): Need to add support for facades/backends to Bazel.
56 PW_TOKENIZER_GLOBAL_HANDLER_BACKEND = "//pw_tokenizer:test_backend"
58 PW_TOKENIZER_GLOBAL_HANDLER_WITH_PAYLOAD_BACKEND = "//pw_tokenizer:test_backend"
61 name = "test_backend",
62 visibility = ["//visibility:private"],
66 name = "global_handler",
67 srcs = ["tokenize_to_global_handler.cc"],
68 hdrs = ["public/pw_tokenizer/tokenize_to_global_handler.h"],
71 PW_TOKENIZER_GLOBAL_HANDLER_BACKEND,
76 name = "global_handler_with_payload",
77 srcs = ["tokenize_to_global_handler_with_payload.cc"],
78 hdrs = ["public/pw_tokenizer/tokenize_to_global_handler_with_payload.h"],
81 PW_TOKENIZER_GLOBAL_HANDLER_WITH_PAYLOAD_BACKEND,
91 "public/pw_tokenizer/base64.h",
93 includes = ["public"],
109 "public/pw_tokenizer/detokenize.h",
110 "public/pw_tokenizer/internal/decode.h",
111 "public/pw_tokenizer/token_database.h",
113 includes = ["public"],
120 # Executable for generating test data for the C++ and Python detokenizers. This
121 # target should only be built for the host.
123 name = "generate_decoding_test_data",
125 "generate_decoding_test_data.cc",
126 "tokenize_test_fakes.cc",
137 # Executable for generating a test ELF file for elf_reader_test.py. A host
138 # version of this binary is checked in for use in elf_reader_test.py.
140 name = "elf_reader_test_binary",
142 "py/elf_reader_test_binary.c",
144 linkopts = ["-Wl,--unresolved-symbols=ignore-all"], # main is not defined
152 name = "argument_types_test",
154 "argument_types_test.cc",
155 "argument_types_test_c.c",
156 "pw_tokenizer_private/argument_types_test.h",
157 "tokenize_test_fakes.cc",
167 name = "base64_test",
179 name = "decode_test",
182 "pw_tokenizer_private/tokenized_string_decoding_test_data.h",
183 "pw_tokenizer_private/varint_decoding_test_data.h",
193 name = "detokenize_test",
195 "detokenize_test.cc",
204 name = "global_handlers_test",
206 "global_handlers_test.cc",
207 "global_handlers_test_c.c",
208 "pw_tokenizer_private/tokenize_test.h",
212 ":global_handler_with_payload",
220 "pw_tokenizer_private/generated_hash_test_cases.h",
221 "tokenize_test_fakes.cc",
231 name = "simple_tokenize_test",
233 "simple_tokenize_test.cc",
242 name = "token_database_test",
244 "token_database_test.cc",
253 name = "tokenize_test",
255 "pw_tokenizer_private/tokenize_test.h",
267 # Create a shared library for the tokenizer JNI wrapper. The include paths for
268 # the JNI headers must be available in the system or provided with the
269 # pw_java_native_interface_include_dirs variable.
271 name = "detokenizer_jni",
273 "java/dev/pigweed/tokenizer/detokenizer.cc",