Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 1 | # Copyright (C) 2017 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://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, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Primiano Tucci | c167887 | 2019-03-20 11:30:54 +0000 | [diff] [blame] | 15 | import("../../gn/fuzzer.gni") |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 16 | import("../../gn/perfetto.gni") |
| 17 | import("../../gn/proto_library.gni") |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 18 | import("../../gn/test.gni") |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 19 | |
| 20 | source_set("protozero") { |
| 21 | public_configs = [ "../../gn:default_config" ] |
| 22 | public_deps = [ |
| 23 | "../../include/perfetto/protozero", |
| 24 | ] |
| 25 | deps = [ |
| 26 | "../../gn:default_deps", |
Primiano Tucci | 2c5488f | 2019-06-01 03:27:28 +0100 | [diff] [blame] | 27 | "../../include/perfetto/base", |
| 28 | "../../include/perfetto/ext/base", # TODO(primiano): remove this |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 29 | ] |
| 30 | sources = [ |
Hector Dearman | e1e56b6 | 2018-02-21 19:11:58 +0000 | [diff] [blame] | 31 | "message.cc", |
| 32 | "message_handle.cc", |
Primiano Tucci | 03ac833 | 2019-11-06 13:30:36 +0000 | [diff] [blame^] | 33 | "packed_repeated_fields.cc", |
Lalit Maganti | 45172a8 | 2018-06-01 03:04:43 +0100 | [diff] [blame] | 34 | "proto_decoder.cc", |
Eric Seckler | 7631120 | 2019-01-07 12:20:25 +0000 | [diff] [blame] | 35 | "scattered_heap_buffer.cc", |
Hector Dearman | 9a5a0e9 | 2018-03-27 17:52:24 +0100 | [diff] [blame] | 36 | "scattered_stream_null_delegate.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 37 | "scattered_stream_writer.cc", |
| 38 | ] |
| 39 | } |
| 40 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 41 | static_library("libprotozero") { |
| 42 | complete_static_lib = true |
| 43 | deps = [ |
| 44 | ":protozero", |
| 45 | ] |
Hector Dearman | 8a1a6b6 | 2019-02-08 14:18:00 +0000 | [diff] [blame] | 46 | } |
| 47 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 48 | perfetto_unittest_source_set("unittests") { |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 49 | testonly = true |
| 50 | deps = [ |
| 51 | ":protozero", |
| 52 | ":testing_messages_lite", |
| 53 | ":testing_messages_zero", |
| 54 | "../../gn:default_deps", |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 55 | "../../gn:gtest_and_gmock", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 56 | "../base", |
Eric Seckler | 2643c8f | 2019-01-18 07:35:58 +0000 | [diff] [blame] | 57 | "../base:test_support", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 58 | ] |
| 59 | sources = [ |
Hector Dearman | e1e56b6 | 2018-02-21 19:11:58 +0000 | [diff] [blame] | 60 | "message_handle_unittest.cc", |
| 61 | "message_unittest.cc", |
Lalit Maganti | 45172a8 | 2018-06-01 03:04:43 +0100 | [diff] [blame] | 62 | "proto_decoder_unittest.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 63 | "proto_utils_unittest.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 64 | "scattered_stream_writer_unittest.cc", |
| 65 | "test/fake_scattered_buffer.cc", |
| 66 | "test/fake_scattered_buffer.h", |
| 67 | "test/protozero_conformance_unittest.cc", |
| 68 | ] |
| 69 | } |
| 70 | |
| 71 | # Generates both xxx.pbzero.h and xxx.pb.h (official proto). |
| 72 | |
Primiano Tucci | 2cf8b53 | 2019-08-29 01:14:01 +0200 | [diff] [blame] | 73 | perfetto_proto_library("testing_messages_@TYPE@") { |
Primiano Tucci | 57dd66b | 2019-10-15 23:09:04 +0100 | [diff] [blame] | 74 | proto_generators = [ |
| 75 | "lite", |
| 76 | "zero", |
| 77 | ] |
Primiano Tucci | 2cf8b53 | 2019-08-29 01:14:01 +0200 | [diff] [blame] | 78 | sources = [ |
| 79 | "test/example_proto/library.proto", |
| 80 | "test/example_proto/library_internals/galaxies.proto", |
| 81 | "test/example_proto/test_messages.proto", |
| 82 | "test/example_proto/upper_import.proto", |
| 83 | ] |
| 84 | proto_path = perfetto_root_path |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 85 | } |
Primiano Tucci | c167887 | 2019-03-20 11:30:54 +0000 | [diff] [blame] | 86 | |
| 87 | perfetto_fuzzer_test("protozero_decoder_fuzzer") { |
| 88 | sources = [ |
| 89 | "proto_decoder_fuzzer.cc", |
| 90 | ] |
| 91 | deps = [ |
| 92 | ":protozero", |
| 93 | "../../gn:default_deps", |
Primiano Tucci | 2c5488f | 2019-06-01 03:27:28 +0100 | [diff] [blame] | 94 | "../base", |
Primiano Tucci | c167887 | 2019-03-20 11:30:54 +0000 | [diff] [blame] | 95 | ] |
| 96 | } |