aboutsummaryrefslogtreecommitdiff
path: root/src/protozero/BUILD.gn
blob: e4cbd826907b7f2b8c1e4183af4c7eacdfd947fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("../../gn/fuzzer.gni")
import("../../gn/perfetto.gni")
import("../../gn/proto_library.gni")
import("../../gn/test.gni")

source_set("protozero") {
  public_configs = [ "../../gn:default_config" ]
  public_deps = [
    "../../include/perfetto/base",
    "../../include/perfetto/protozero",
  ]
  deps = [
    "../../gn:default_deps",
    "../base",
  ]
  sources = [
    "field.cc",
    "message.cc",
    "message_handle.cc",
    "packed_repeated_fields.cc",
    "proto_decoder.cc",
    "scattered_heap_buffer.cc",
    "scattered_stream_null_delegate.cc",
    "scattered_stream_writer.cc",
    "static_buffer.cc",
    "virtual_destructors.cc",
  ]
}

static_library("libprotozero") {
  complete_static_lib = true
  deps = [
    ":protozero",
  ]
}

perfetto_unittest_source_set("unittests") {
  testonly = true
  deps = [
    ":protozero",
    ":testing_messages_cpp",
    ":testing_messages_lite",
    ":testing_messages_zero",
    "../../gn:default_deps",
    "../../gn:gtest_and_gmock",
    "../base",
    "../base:test_support",
  ]
  sources = [
    "copyable_ptr_unittest.cc",
    "message_handle_unittest.cc",
    "message_unittest.cc",
    "proto_decoder_unittest.cc",
    "proto_utils_unittest.cc",
    "scattered_stream_writer_unittest.cc",
    "test/cppgen_conformance_unittest.cc",
    "test/fake_scattered_buffer.cc",
    "test/fake_scattered_buffer.h",
    "test/protozero_conformance_unittest.cc",
  ]
}

# Generates both xxx.pbzero.h and xxx.pb.h (official proto).

perfetto_proto_library("testing_messages_@TYPE@") {
  sources = [
    "test/example_proto/library.proto",
    "test/example_proto/library_internals/galaxies.proto",
    "test/example_proto/test_messages.proto",
    "test/example_proto/upper_import.proto",
  ]
  proto_path = perfetto_root_path
}

perfetto_fuzzer_test("protozero_decoder_fuzzer") {
  sources = [
    "proto_decoder_fuzzer.cc",
  ]
  deps = [
    ":protozero",
    "../../gn:default_deps",
    "../base",
  ]
}