# 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/perfetto_cc_proto_descriptor.gni") import("../../gn/perfetto_component.gni") import("../../gn/proto_library.gni") import("../../gn/test.gni") perfetto_component("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_arena.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", ] } 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", "filtering:unittests", ] 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/extensions.proto", "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_proto_library("test_messages_descriptor") { proto_generators = [ "descriptor" ] generate_descriptor = "test_messages.descriptor" sources = [ "test/example_proto/test_messages.proto" ] deps = [ ":testing_messages_source_set" ] } perfetto_fuzzer_test("protozero_decoder_fuzzer") { sources = [ "proto_decoder_fuzzer.cc" ] deps = [ ":protozero", "../../gn:default_deps", "../base", ] } if (enable_perfetto_benchmarks) { source_set("benchmarks") { testonly = true deps = [ ":protozero", ":testing_messages_lite", ":testing_messages_zero", "../../gn:benchmark", "../../gn:default_deps", ] sources = [ "test/protozero_benchmark.cc" ] } }