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") |
Lalit Maganti | 2939c08 | 2021-03-11 17:25:44 +0000 | [diff] [blame] | 17 | import("../../gn/perfetto_cc_proto_descriptor.gni") |
Primiano Tucci | 916f4e5 | 2020-10-16 20:40:33 +0200 | [diff] [blame] | 18 | import("../../gn/perfetto_component.gni") |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 19 | import("../../gn/proto_library.gni") |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 20 | import("../../gn/test.gni") |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 21 | |
Primiano Tucci | 916f4e5 | 2020-10-16 20:40:33 +0200 | [diff] [blame] | 22 | perfetto_component("protozero") { |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 23 | public_configs = [ "../../gn:default_config" ] |
| 24 | public_deps = [ |
Lalit Maganti | bc50873 | 2019-12-09 13:46:07 +0000 | [diff] [blame] | 25 | "../../include/perfetto/base", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 26 | "../../include/perfetto/protozero", |
| 27 | ] |
| 28 | deps = [ |
| 29 | "../../gn:default_deps", |
Lalit Maganti | bc50873 | 2019-12-09 13:46:07 +0000 | [diff] [blame] | 30 | "../base", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 31 | ] |
| 32 | sources = [ |
Primiano Tucci | 6a7813d | 2019-11-19 11:08:50 +0000 | [diff] [blame] | 33 | "field.cc", |
Hector Dearman | e1e56b6 | 2018-02-21 19:11:58 +0000 | [diff] [blame] | 34 | "message.cc", |
Primiano Tucci | acb6ca3 | 2020-08-19 13:27:52 +0200 | [diff] [blame] | 35 | "message_arena.cc", |
Hector Dearman | e1e56b6 | 2018-02-21 19:11:58 +0000 | [diff] [blame] | 36 | "message_handle.cc", |
Primiano Tucci | 03ac833 | 2019-11-06 13:30:36 +0000 | [diff] [blame] | 37 | "packed_repeated_fields.cc", |
Lalit Maganti | 45172a8 | 2018-06-01 03:04:43 +0100 | [diff] [blame] | 38 | "proto_decoder.cc", |
Eric Seckler | 7631120 | 2019-01-07 12:20:25 +0000 | [diff] [blame] | 39 | "scattered_heap_buffer.cc", |
Hector Dearman | 9a5a0e9 | 2018-03-27 17:52:24 +0100 | [diff] [blame] | 40 | "scattered_stream_null_delegate.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 41 | "scattered_stream_writer.cc", |
Primiano Tucci | 6a7fa5f | 2019-11-19 11:09:20 +0000 | [diff] [blame] | 42 | "static_buffer.cc", |
Primiano Tucci | cb8cea2 | 2019-11-22 11:05:35 +0000 | [diff] [blame] | 43 | "virtual_destructors.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 44 | ] |
| 45 | } |
| 46 | |
Lalit Maganti | 7d4b92b | 2021-05-20 17:16:51 +0100 | [diff] [blame] | 47 | source_set("proto_ring_buffer") { |
| 48 | deps = [ |
| 49 | ":protozero", |
| 50 | "../../gn:default_deps", |
| 51 | "../base", |
| 52 | ] |
| 53 | sources = [ |
| 54 | "proto_ring_buffer.cc", |
| 55 | "proto_ring_buffer.h", |
| 56 | ] |
| 57 | } |
| 58 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 59 | perfetto_unittest_source_set("unittests") { |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 60 | testonly = true |
| 61 | deps = [ |
Lalit Maganti | 7d4b92b | 2021-05-20 17:16:51 +0100 | [diff] [blame] | 62 | ":proto_ring_buffer", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 63 | ":protozero", |
Primiano Tucci | 6a7813d | 2019-11-19 11:08:50 +0000 | [diff] [blame] | 64 | ":testing_messages_cpp", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 65 | ":testing_messages_lite", |
| 66 | ":testing_messages_zero", |
| 67 | "../../gn:default_deps", |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 68 | "../../gn:gtest_and_gmock", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 69 | "../base", |
Eric Seckler | 2643c8f | 2019-01-18 07:35:58 +0000 | [diff] [blame] | 70 | "../base:test_support", |
Primiano Tucci | d4b49cb | 2021-05-13 09:53:46 +0100 | [diff] [blame] | 71 | "filtering:unittests", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 72 | ] |
| 73 | sources = [ |
Primiano Tucci | e4144b7 | 2019-11-07 16:10:19 +0000 | [diff] [blame] | 74 | "copyable_ptr_unittest.cc", |
Hector Dearman | e1e56b6 | 2018-02-21 19:11:58 +0000 | [diff] [blame] | 75 | "message_handle_unittest.cc", |
| 76 | "message_unittest.cc", |
Lalit Maganti | 45172a8 | 2018-06-01 03:04:43 +0100 | [diff] [blame] | 77 | "proto_decoder_unittest.cc", |
Lalit Maganti | 7d4b92b | 2021-05-20 17:16:51 +0100 | [diff] [blame] | 78 | "proto_ring_buffer_unittest.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 79 | "proto_utils_unittest.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 80 | "scattered_stream_writer_unittest.cc", |
Primiano Tucci | 6a7813d | 2019-11-19 11:08:50 +0000 | [diff] [blame] | 81 | "test/cppgen_conformance_unittest.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 82 | "test/fake_scattered_buffer.cc", |
| 83 | "test/fake_scattered_buffer.h", |
| 84 | "test/protozero_conformance_unittest.cc", |
| 85 | ] |
| 86 | } |
| 87 | |
| 88 | # Generates both xxx.pbzero.h and xxx.pb.h (official proto). |
| 89 | |
Primiano Tucci | 2cf8b53 | 2019-08-29 01:14:01 +0200 | [diff] [blame] | 90 | perfetto_proto_library("testing_messages_@TYPE@") { |
| 91 | sources = [ |
Andrew Shulaev | 4cfa396 | 2020-06-15 17:16:18 +0100 | [diff] [blame] | 92 | "test/example_proto/extensions.proto", |
Primiano Tucci | 2cf8b53 | 2019-08-29 01:14:01 +0200 | [diff] [blame] | 93 | "test/example_proto/library.proto", |
| 94 | "test/example_proto/library_internals/galaxies.proto", |
| 95 | "test/example_proto/test_messages.proto", |
| 96 | "test/example_proto/upper_import.proto", |
| 97 | ] |
| 98 | proto_path = perfetto_root_path |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 99 | } |
Primiano Tucci | c167887 | 2019-03-20 11:30:54 +0000 | [diff] [blame] | 100 | |
Lalit Maganti | 2939c08 | 2021-03-11 17:25:44 +0000 | [diff] [blame] | 101 | perfetto_proto_library("test_messages_descriptor") { |
| 102 | proto_generators = [ "descriptor" ] |
| 103 | generate_descriptor = "test_messages.descriptor" |
| 104 | sources = [ "test/example_proto/test_messages.proto" ] |
| 105 | deps = [ ":testing_messages_source_set" ] |
| 106 | } |
| 107 | |
Primiano Tucci | c167887 | 2019-03-20 11:30:54 +0000 | [diff] [blame] | 108 | perfetto_fuzzer_test("protozero_decoder_fuzzer") { |
Primiano Tucci | 2925e9d | 2020-01-27 10:15:58 +0000 | [diff] [blame] | 109 | sources = [ "proto_decoder_fuzzer.cc" ] |
Primiano Tucci | c167887 | 2019-03-20 11:30:54 +0000 | [diff] [blame] | 110 | deps = [ |
| 111 | ":protozero", |
| 112 | "../../gn:default_deps", |
Primiano Tucci | 2c5488f | 2019-06-01 03:27:28 +0100 | [diff] [blame] | 113 | "../base", |
Primiano Tucci | c167887 | 2019-03-20 11:30:54 +0000 | [diff] [blame] | 114 | ] |
| 115 | } |
Primiano Tucci | df3ab20 | 2020-05-21 14:20:57 +0100 | [diff] [blame] | 116 | |
| 117 | if (enable_perfetto_benchmarks) { |
| 118 | source_set("benchmarks") { |
| 119 | testonly = true |
| 120 | deps = [ |
| 121 | ":protozero", |
| 122 | ":testing_messages_lite", |
| 123 | ":testing_messages_zero", |
| 124 | "../../gn:benchmark", |
| 125 | "../../gn:default_deps", |
| 126 | ] |
| 127 | sources = [ "test/protozero_benchmark.cc" ] |
| 128 | } |
| 129 | } |