blob: bcc34e0c65149f2af7e1ee7040374a6c97d679b3 [file] [log] [blame]
Primiano Tucci4f9b6d72017-12-05 20:59:16 +00001# 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 Tuccic1678872019-03-20 11:30:54 +000015import("../../gn/fuzzer.gni")
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000016import("../../gn/perfetto.gni")
17import("../../gn/proto_library.gni")
Primiano Tucci02c11762019-08-30 00:57:59 +020018import("../../gn/test.gni")
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000019
20source_set("protozero") {
21 public_configs = [ "../../gn:default_config" ]
22 public_deps = [
23 "../../include/perfetto/protozero",
24 ]
25 deps = [
26 "../../gn:default_deps",
Primiano Tucci2c5488f2019-06-01 03:27:28 +010027 "../../include/perfetto/base",
28 "../../include/perfetto/ext/base", # TODO(primiano): remove this
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000029 ]
30 sources = [
Hector Dearmane1e56b62018-02-21 19:11:58 +000031 "message.cc",
32 "message_handle.cc",
Primiano Tucci03ac8332019-11-06 13:30:36 +000033 "packed_repeated_fields.cc",
Lalit Maganti45172a82018-06-01 03:04:43 +010034 "proto_decoder.cc",
Eric Seckler76311202019-01-07 12:20:25 +000035 "scattered_heap_buffer.cc",
Hector Dearman9a5a0e92018-03-27 17:52:24 +010036 "scattered_stream_null_delegate.cc",
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000037 "scattered_stream_writer.cc",
38 ]
39}
40
Primiano Tucci02c11762019-08-30 00:57:59 +020041static_library("libprotozero") {
42 complete_static_lib = true
43 deps = [
44 ":protozero",
45 ]
Hector Dearman8a1a6b62019-02-08 14:18:00 +000046}
47
Primiano Tucci02c11762019-08-30 00:57:59 +020048perfetto_unittest_source_set("unittests") {
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000049 testonly = true
50 deps = [
51 ":protozero",
52 ":testing_messages_lite",
53 ":testing_messages_zero",
54 "../../gn:default_deps",
Primiano Tucci13ae72f2019-06-06 10:53:02 +010055 "../../gn:gtest_and_gmock",
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000056 "../base",
Eric Seckler2643c8f2019-01-18 07:35:58 +000057 "../base:test_support",
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000058 ]
59 sources = [
Hector Dearmane1e56b62018-02-21 19:11:58 +000060 "message_handle_unittest.cc",
61 "message_unittest.cc",
Lalit Maganti45172a82018-06-01 03:04:43 +010062 "proto_decoder_unittest.cc",
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000063 "proto_utils_unittest.cc",
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000064 "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 Tucci2cf8b532019-08-29 01:14:01 +020073perfetto_proto_library("testing_messages_@TYPE@") {
Primiano Tucci57dd66b2019-10-15 23:09:04 +010074 proto_generators = [
75 "lite",
76 "zero",
77 ]
Primiano Tucci2cf8b532019-08-29 01:14:01 +020078 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 Tucci4f9b6d72017-12-05 20:59:16 +000085}
Primiano Tuccic1678872019-03-20 11:30:54 +000086
87perfetto_fuzzer_test("protozero_decoder_fuzzer") {
88 sources = [
89 "proto_decoder_fuzzer.cc",
90 ]
91 deps = [
92 ":protozero",
93 "../../gn:default_deps",
Primiano Tucci2c5488f2019-06-01 03:27:28 +010094 "../base",
Primiano Tuccic1678872019-03-20 11:30:54 +000095 ]
96}