blob: 8a0305f09db2dd8e0754e102985b474cd4223935 [file] [log] [blame]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -08001# Copyright 2020 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
Armando Montanezfb3d3fb2020-06-09 18:12:12 -070015import("//build_overrides/pigweed.gni")
16
Anthony DiGirolamoeea0d772020-08-06 12:00:36 -070017import("$dir_pw_arduino_build/arduino.gni")
Wyatt Hepler6639c452020-05-06 11:43:07 -070018import("$dir_pw_build/facade.gni")
Wyatt Hepler86632c72020-10-15 08:45:50 -070019import("$dir_pw_build/module_config.gni")
Alexei Frolovedd2f142020-06-09 19:11:27 -070020import("$dir_pw_build/target_types.gni")
Wyatt Hepler80c6ee52020-01-03 09:54:58 -080021import("$dir_pw_docgen/docs.gni")
karthik bharadwajeabe9a22020-04-14 09:28:28 -070022import("$dir_pw_fuzzer/fuzzer.gni")
Wyatt Hepler80c6ee52020-01-03 09:54:58 -080023import("$dir_pw_unit_test/test.gni")
Alexei Frolov4c0428a2020-06-10 10:46:04 -070024import("backend.gni")
Wyatt Heplerd49f8fe2020-10-15 10:13:47 -070025
Wyatt Hepler86632c72020-10-15 08:45:50 -070026declare_args() {
27 # The build target that overrides the default configuration options for this
28 # module. This should point to a source set that provides defines through a
29 # public config (which may -include a file or add defines directly).
30 pw_tokenizer_CONFIG = pw_build_DEFAULT_MODULE_CONFIG
31}
32
33config("public_include_path") {
Wyatt Hepler80c6ee52020-01-03 09:54:58 -080034 include_dirs = [ "public" ]
Wyatt Hepler86632c72020-10-15 08:45:50 -070035 visibility = [ ":*" ]
36}
37
Wyatt Hepler3a8df982020-11-03 14:06:28 -080038config("linker_script") {
39 inputs = [ "pw_tokenizer_linker_sections.ld" ]
40
41 # Automatically add the tokenizer linker sections when cross-compiling or
42 # building for Linux. macOS and Windows executables are not supported.
43 if (current_os == "") {
44 ldflags = [
45 "-T",
46 rebase_path("pw_tokenizer_linker_sections.ld"),
47 ]
Wyatt Hepler1df2e5b2021-01-28 12:39:22 -080048 } else if (current_os == "linux" && !pw_toolchain_OSS_FUZZ_ENABLED) {
Wyatt Hepler3a8df982020-11-03 14:06:28 -080049 # When building for Linux, the linker provides a default linker script.
50 # The add_tokenizer_sections_to_default_script.ld wrapper includes the
51 # pw_tokenizer_linker_sections.ld script in a way that appends to the the
52 # default linker script instead of overriding it.
53 ldflags = [
54 "-T",
55 rebase_path("add_tokenizer_sections_to_default_script.ld"),
56 "-L",
57 rebase_path("."),
58 ]
59 inputs += [ "add_tokenizer_sections_to_default_script.ld" ]
60 }
61 visibility = [ ":*" ]
62}
63
Wyatt Hepler86632c72020-10-15 08:45:50 -070064pw_source_set("config") {
65 public = [ "public/pw_tokenizer/config.h" ]
66 public_configs = [ ":public_include_path" ]
67 public_deps = [ pw_tokenizer_CONFIG ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -080068}
69
Alexei Frolovedd2f142020-06-09 19:11:27 -070070pw_source_set("pw_tokenizer") {
Wyatt Hepler86632c72020-10-15 08:45:50 -070071 public_configs = [ ":public_include_path" ]
Wyatt Hepler3a8df982020-11-03 14:06:28 -080072 all_dependent_configs = [ ":linker_script" ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -080073 public_deps = [
Wyatt Hepler86632c72020-10-15 08:45:50 -070074 ":config",
Wyatt Hepler6639c452020-05-06 11:43:07 -070075 dir_pw_preprocessor,
Wyatt Hepler80c6ee52020-01-03 09:54:58 -080076 ]
Wyatt Hepler6639c452020-05-06 11:43:07 -070077 deps = [ dir_pw_varint ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -080078 public = [
Wyatt Hepler7c8b3392021-04-05 18:00:24 -070079 "public/pw_tokenizer/encode_args.h",
Wyatt Heplereb020a12020-10-28 14:01:51 -070080 "public/pw_tokenizer/hash.h",
Wyatt Hepler80c6ee52020-01-03 09:54:58 -080081 "public/pw_tokenizer/tokenize.h",
82 ]
83 sources = [
Wyatt Hepler6639c452020-05-06 11:43:07 -070084 "encode_args.cc",
Wyatt Hepler656fac62020-10-28 14:30:59 -070085 "hash.cc",
Wyatt Hepler80c6ee52020-01-03 09:54:58 -080086 "public/pw_tokenizer/internal/argument_types.h",
87 "public/pw_tokenizer/internal/argument_types_macro_4_byte.h",
88 "public/pw_tokenizer/internal/argument_types_macro_8_byte.h",
89 "public/pw_tokenizer/internal/pw_tokenizer_65599_fixed_length_128_hash_macro.h",
Wyatt Hepler63c9bee2021-02-23 11:37:15 -080090 "public/pw_tokenizer/internal/pw_tokenizer_65599_fixed_length_256_hash_macro.h",
Wyatt Hepler80c6ee52020-01-03 09:54:58 -080091 "public/pw_tokenizer/internal/pw_tokenizer_65599_fixed_length_80_hash_macro.h",
92 "public/pw_tokenizer/internal/pw_tokenizer_65599_fixed_length_96_hash_macro.h",
93 "public/pw_tokenizer/internal/tokenize_string.h",
94 "tokenize.cc",
95 ]
Wyatt Heplera8557ef2020-05-04 16:29:23 -070096 friend = [ ":*" ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -080097}
98
Wyatt Hepler6639c452020-05-06 11:43:07 -070099# As a temporary workaround, if no backend is set, use an empty test backend so
100# that the test can define the handler function.
101# TODO(hepler): Switch this to a facade test when available.
Alexei Frolov4c0428a2020-06-10 10:46:04 -0700102if (pw_tokenizer_GLOBAL_HANDLER_BACKEND == "" &&
103 pw_tokenizer_GLOBAL_HANDLER_WITH_PAYLOAD_BACKEND == "") {
Wyatt Hepler6639c452020-05-06 11:43:07 -0700104 # This is an empty library to use as the backend for global_handler and
105 # global_handler_with_payload tests.
Alexei Frolovedd2f142020-06-09 19:11:27 -0700106 pw_source_set("test_backend") {
Wyatt Hepler6639c452020-05-06 11:43:07 -0700107 visibility = [ ":*" ]
108 }
109
Alexei Frolov4c0428a2020-06-10 10:46:04 -0700110 pw_tokenizer_GLOBAL_HANDLER_BACKEND = ":test_backend"
111 pw_tokenizer_GLOBAL_HANDLER_WITH_PAYLOAD_BACKEND = ":test_backend"
Wyatt Hepler6639c452020-05-06 11:43:07 -0700112
113 enable_global_handler_test = true
114} else {
115 enable_global_handler_test = false
116}
117
118pw_facade("global_handler") {
Alexei Frolov4c0428a2020-06-10 10:46:04 -0700119 backend = pw_tokenizer_GLOBAL_HANDLER_BACKEND
Wyatt Hepler6639c452020-05-06 11:43:07 -0700120
Wyatt Hepler86632c72020-10-15 08:45:50 -0700121 public_configs = [ ":public_include_path" ]
Wyatt Hepler6639c452020-05-06 11:43:07 -0700122 public = [ "public/pw_tokenizer/tokenize_to_global_handler.h" ]
123 sources = [ "tokenize_to_global_handler.cc" ]
124 public_deps = [ ":pw_tokenizer" ]
125}
126
127pw_facade("global_handler_with_payload") {
Alexei Frolov4c0428a2020-06-10 10:46:04 -0700128 backend = pw_tokenizer_GLOBAL_HANDLER_WITH_PAYLOAD_BACKEND
Wyatt Hepler6639c452020-05-06 11:43:07 -0700129
Wyatt Hepler86632c72020-10-15 08:45:50 -0700130 public_configs = [ ":public_include_path" ]
Wyatt Hepler6639c452020-05-06 11:43:07 -0700131 public = [ "public/pw_tokenizer/tokenize_to_global_handler_with_payload.h" ]
132 sources = [ "tokenize_to_global_handler_with_payload.cc" ]
133 public_deps = [ ":pw_tokenizer" ]
134}
135
Alexei Frolovedd2f142020-06-09 19:11:27 -0700136pw_source_set("base64") {
Wyatt Hepler86632c72020-10-15 08:45:50 -0700137 public_configs = [ ":public_include_path" ]
Rob Mohra0ba54f2020-02-27 11:43:49 -0800138 public = [ "public/pw_tokenizer/base64.h" ]
Wyatt Heplera8557ef2020-05-04 16:29:23 -0700139 sources = [ "base64.cc" ]
Wyatt Hepler3c2e9522020-01-09 16:08:54 -0800140 public_deps = [
Wyatt Heplercdafbb42020-10-05 11:51:05 -0700141 ":pw_tokenizer",
142 dir_pw_base64,
Wyatt Hepler6639c452020-05-06 11:43:07 -0700143 dir_pw_preprocessor,
Wyatt Hepler3c2e9522020-01-09 16:08:54 -0800144 ]
Wyatt Hepler3c2e9522020-01-09 16:08:54 -0800145}
146
Alexei Frolovedd2f142020-06-09 19:11:27 -0700147pw_source_set("decoder") {
Wyatt Hepler86632c72020-10-15 08:45:50 -0700148 public_configs = [ ":public_include_path" ]
Wyatt Hepler6639c452020-05-06 11:43:07 -0700149 deps = [ dir_pw_varint ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800150 public = [
151 "public/pw_tokenizer/detokenize.h",
152 "public/pw_tokenizer/token_database.h",
153 ]
154 sources = [
155 "decode.cc",
156 "detokenize.cc",
157 "public/pw_tokenizer/internal/decode.h",
158 "token_database.cc",
159 ]
Wyatt Heplera8557ef2020-05-04 16:29:23 -0700160 friend = [ ":*" ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800161}
162
163# Executable for generating test data for the C++ and Python detokenizers. This
164# target should only be built for the host.
Alexei Frolov2e55ee22020-06-17 17:00:10 -0700165pw_executable("generate_decoding_test_data") {
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800166 deps = [
167 ":decoder",
168 ":pw_tokenizer",
Wyatt Hepler6639c452020-05-06 11:43:07 -0700169 dir_pw_varint,
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800170 ]
Ewout van Bekkume4d7b692020-10-15 13:12:30 -0700171 sources = [ "generate_decoding_test_data.cc" ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800172}
173
Wyatt Heplerbc254972020-01-06 18:35:30 -0800174# Executable for generating a test ELF file for elf_reader_test.py. A host
175# version of this binary is checked in for use in elf_reader_test.py.
Alexei Frolov2e55ee22020-06-17 17:00:10 -0700176pw_executable("elf_reader_test_binary") {
Wyatt Heplerbc254972020-01-06 18:35:30 -0800177 deps = [
178 ":pw_tokenizer",
179 "$dir_pw_varint",
180 ]
Rob Mohra0ba54f2020-02-27 11:43:49 -0800181 sources = [ "py/elf_reader_test_binary.c" ]
Wyatt Heplerbc254972020-01-06 18:35:30 -0800182 ldflags = [ "-Wl,--unresolved-symbols=ignore-all" ] # main is not defined
183}
184
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800185pw_test_group("tests") {
186 tests = [
187 ":argument_types_test",
Wyatt Hepler3c2e9522020-01-09 16:08:54 -0800188 ":base64_test",
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800189 ":decode_test",
karthik bharadwajeabe9a22020-04-14 09:28:28 -0700190 ":detokenize_fuzzer",
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800191 ":detokenize_test",
Wyatt Hepler6639c452020-05-06 11:43:07 -0700192 ":global_handlers_test",
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800193 ":hash_test",
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800194 ":simple_tokenize_test_cpp11",
195 ":simple_tokenize_test_cpp14",
196 ":simple_tokenize_test_cpp17",
karthik bharadwaj2ee244b2020-04-16 14:08:22 -0700197 ":token_database_fuzzer",
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800198 ":token_database_test",
199 ":tokenize_test",
200 ]
Wyatt Hepler7abd8cc2021-01-19 16:49:33 -0800201 group_deps = [ "$dir_pw_preprocessor:tests" ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800202}
203
204pw_test("argument_types_test") {
205 sources = [
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800206 "argument_types_test.cc",
Michael Spanga99220e2020-06-11 20:07:16 -0400207 "argument_types_test_c.c",
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800208 "pw_tokenizer_private/argument_types_test.h",
209 ]
Rob Mohra0ba54f2020-02-27 11:43:49 -0800210 deps = [ ":pw_tokenizer" ]
Anthony DiGirolamoeea0d772020-08-06 12:00:36 -0700211
Anthony DiGirolamo383be052020-11-26 12:06:41 -0800212 if (pw_arduino_build_CORE_PATH != "") {
Anthony DiGirolamoeea0d772020-08-06 12:00:36 -0700213 remove_configs = [ "$dir_pw_build:strict_warnings" ]
214 }
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800215}
216
Wyatt Hepler3c2e9522020-01-09 16:08:54 -0800217pw_test("base64_test") {
Rob Mohra0ba54f2020-02-27 11:43:49 -0800218 sources = [ "base64_test.cc" ]
219 deps = [ ":base64" ]
Wyatt Hepler3c2e9522020-01-09 16:08:54 -0800220}
221
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800222pw_test("decode_test") {
223 sources = [
224 "decode_test.cc",
225 "pw_tokenizer_private/tokenized_string_decoding_test_data.h",
226 "pw_tokenizer_private/varint_decoding_test_data.h",
227 ]
228 deps = [
229 ":decoder",
230 "$dir_pw_varint",
231 ]
Anthony DiGirolamob5079172020-11-05 12:59:50 -0800232
233 # TODO(tonymd): This fails on Teensyduino 1.54 beta core. It may be related to
234 # linking in stl functions. Will debug when 1.54 is released.
235 enable_if = pw_build_EXECUTABLE_TARGET_TYPE != "arduino_executable"
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800236}
237
238pw_test("detokenize_test") {
Rob Mohra0ba54f2020-02-27 11:43:49 -0800239 sources = [ "detokenize_test.cc" ]
240 deps = [ ":decoder" ]
Anthony DiGirolamob5079172020-11-05 12:59:50 -0800241
242 # TODO(tonymd): This fails on Teensyduino 1.54 beta core. It may be related to
243 # linking in stl functions. Will debug when 1.54 is released.
244 enable_if = pw_build_EXECUTABLE_TARGET_TYPE != "arduino_executable"
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800245}
246
Wyatt Hepler6639c452020-05-06 11:43:07 -0700247pw_test("global_handlers_test") {
248 sources = [
Wyatt Hepler6639c452020-05-06 11:43:07 -0700249 "global_handlers_test.cc",
Michael Spanga99220e2020-06-11 20:07:16 -0400250 "global_handlers_test_c.c",
Wyatt Hepler6639c452020-05-06 11:43:07 -0700251 "pw_tokenizer_private/tokenize_test.h",
252 ]
253 deps = [
254 ":global_handler",
255 ":global_handler_with_payload",
256 ]
257
258 # TODO(hepler): Switch this to a facade test when available.
259 enable_if = enable_global_handler_test
260}
261
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800262pw_test("hash_test") {
263 sources = [
264 "hash_test.cc",
265 "pw_tokenizer_private/generated_hash_test_cases.h",
266 ]
Rob Mohra0ba54f2020-02-27 11:43:49 -0800267 deps = [ ":pw_tokenizer" ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800268}
269
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800270# Fully test C++11 and C++14 compatibility by compiling all sources as C++11 or
271# C++14.
272_simple_tokenize_test_sources = [
Rob Mohra0ba54f2020-02-27 11:43:49 -0800273 "$dir_pw_varint/public/pw_varint/varint.h",
274 "$dir_pw_varint/varint.cc",
Wyatt Hepler6639c452020-05-06 11:43:07 -0700275 "encode_args.cc",
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800276 "public/pw_tokenizer/config.h",
Wyatt Hepler7c8b3392021-04-05 18:00:24 -0700277 "public/pw_tokenizer/encode_args.h",
Wyatt Heplereb020a12020-10-28 14:01:51 -0700278 "public/pw_tokenizer/hash.h",
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800279 "public/pw_tokenizer/internal/argument_types.h",
280 "public/pw_tokenizer/internal/argument_types_macro_4_byte.h",
281 "public/pw_tokenizer/internal/argument_types_macro_8_byte.h",
282 "public/pw_tokenizer/internal/pw_tokenizer_65599_fixed_length_128_hash_macro.h",
283 "public/pw_tokenizer/internal/pw_tokenizer_65599_fixed_length_80_hash_macro.h",
284 "public/pw_tokenizer/internal/pw_tokenizer_65599_fixed_length_96_hash_macro.h",
285 "public/pw_tokenizer/internal/tokenize_string.h",
Rob Mohra0ba54f2020-02-27 11:43:49 -0800286 "public/pw_tokenizer/tokenize.h",
Wyatt Hepler6639c452020-05-06 11:43:07 -0700287 "public/pw_tokenizer/tokenize_to_global_handler.h",
288 "public/pw_tokenizer/tokenize_to_global_handler_with_payload.h",
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800289 "simple_tokenize_test.cc",
Rob Mohra0ba54f2020-02-27 11:43:49 -0800290 "tokenize.cc",
Wyatt Hepler6639c452020-05-06 11:43:07 -0700291 "tokenize_to_global_handler.cc",
292 "tokenize_to_global_handler_with_payload.cc",
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800293]
294_simple_tokenize_test_configs = [
Wyatt Hepler86632c72020-10-15 08:45:50 -0700295 ":public_include_path",
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800296 "$dir_pw_varint:default_config",
297]
298
299pw_test("simple_tokenize_test_cpp11") {
Alexei Frolov844ff0f2020-05-06 12:15:29 -0700300 remove_configs = [ "$dir_pw_build:cpp17" ]
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800301 configs = [ "$dir_pw_build:cpp11" ] + _simple_tokenize_test_configs
302 sources = _simple_tokenize_test_sources
Rob Mohra0ba54f2020-02-27 11:43:49 -0800303 deps = [ dir_pw_preprocessor ]
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800304}
305
306pw_test("simple_tokenize_test_cpp14") {
Alexei Frolov844ff0f2020-05-06 12:15:29 -0700307 remove_configs = [ "$dir_pw_build:cpp17" ]
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800308 configs = [ "$dir_pw_build:cpp14" ] + _simple_tokenize_test_configs
309 sources = _simple_tokenize_test_sources
Rob Mohra0ba54f2020-02-27 11:43:49 -0800310 deps = [ dir_pw_preprocessor ]
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800311}
312
313pw_test("simple_tokenize_test_cpp17") {
Alexei Frolov844ff0f2020-05-06 12:15:29 -0700314 configs = _simple_tokenize_test_configs
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800315 sources = _simple_tokenize_test_sources
Rob Mohra0ba54f2020-02-27 11:43:49 -0800316 deps = [ dir_pw_preprocessor ]
Wyatt Heplera6d5cc62020-01-17 14:15:40 -0800317}
318
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800319pw_test("token_database_test") {
Rob Mohra0ba54f2020-02-27 11:43:49 -0800320 sources = [ "token_database_test.cc" ]
321 deps = [ ":decoder" ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800322}
323
324pw_test("tokenize_test") {
325 sources = [
326 "pw_tokenizer_private/tokenize_test.h",
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800327 "tokenize_test.cc",
Michael Spanga99220e2020-06-11 20:07:16 -0400328 "tokenize_test_c.c",
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800329 ]
330 deps = [
331 ":pw_tokenizer",
332 "$dir_pw_varint",
333 ]
334}
335
karthik bharadwaj2ee244b2020-04-16 14:08:22 -0700336pw_fuzzer("token_database_fuzzer") {
337 sources = [ "token_database_fuzzer.cc" ]
338 deps = [
339 ":decoder",
340 "$dir_pw_fuzzer",
341 "$dir_pw_preprocessor",
karthik bharadwaj2ee244b2020-04-16 14:08:22 -0700342 ]
343}
344
karthik bharadwajeabe9a22020-04-14 09:28:28 -0700345pw_fuzzer("detokenize_fuzzer") {
346 sources = [ "detokenize_fuzzer.cc" ]
347 deps = [
348 ":decoder",
349 "$dir_pw_fuzzer",
350 "$dir_pw_preprocessor",
351 ]
352}
353
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800354declare_args() {
Alexei Frolov4c0428a2020-06-10 10:46:04 -0700355 # pw_JAVA_NATIVE_INTERFACE_INCLUDE_DIRS specifies the paths to use for
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800356 # building Java Native Interface libraries. If no paths are provided, targets
357 # that require JNI may not build correctly.
358 #
359 # Example JNI include paths for a Linux system:
360 #
Alexei Frolov4c0428a2020-06-10 10:46:04 -0700361 # pw_JAVA_NATIVE_INTERFACE_INCLUDE_DIRS = [
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800362 # "/usr/local/buildtools/java/jdk/include/",
363 # "/usr/local/buildtools/java/jdk/include/linux",
364 # ]
365 #
Alexei Frolov4c0428a2020-06-10 10:46:04 -0700366 pw_JAVA_NATIVE_INTERFACE_INCLUDE_DIRS = []
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800367}
368
369# Create a shared library for the tokenizer JNI wrapper. The include paths for
370# the JNI headers must be available in the system or provided with the
Alexei Frolov4c0428a2020-06-10 10:46:04 -0700371# pw_JAVA_NATIVE_INTERFACE_INCLUDE_DIRS variable.
Alexei Frolovedd2f142020-06-09 19:11:27 -0700372pw_shared_library("detokenizer_jni") {
Wyatt Hepler86632c72020-10-15 08:45:50 -0700373 public_configs = [ ":public_include_path" ]
Alexei Frolov4c0428a2020-06-10 10:46:04 -0700374 include_dirs = pw_JAVA_NATIVE_INTERFACE_INCLUDE_DIRS
Rob Mohra0ba54f2020-02-27 11:43:49 -0800375 sources = [ "java/dev/pigweed/tokenizer/detokenizer.cc" ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800376 public_deps = [
377 ":decoder",
378 "$dir_pw_preprocessor",
379 ]
380}
381
382pw_doc_group("docs") {
Rob Mohra0ba54f2020-02-27 11:43:49 -0800383 sources = [ "docs.rst" ]
Wyatt Heplerf5e984a2020-04-15 18:15:09 -0700384 inputs = [ "py/pw_tokenizer/encode.py" ]
Wyatt Hepler80c6ee52020-01-03 09:54:58 -0800385}