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 15import("../../gn/perfetto.gni") 16import("../../gn/fuzzer.gni") 17import("../../gn/ipc_library.gni") 18import("../../gn/proto_library.gni") 19 20# For use_libfuzzer. 21if (perfetto_build_standalone || perfetto_build_with_android) { 22 import("//gn/standalone/sanitizers/vars.gni") 23} else { 24 import("//build/config/sanitizers/sanitizers.gni") 25} 26 27# This build file should not be leaked into all embedders. Only select 28# projects should be depending on our IPC layer. 29assert(perfetto_build_with_ipc_layer) 30 31source_set("ipc") { 32 public_configs = [ "../../gn:default_config" ] 33 public_deps = [ 34 "../../include/perfetto/ipc", 35 "../base:unix_socket", 36 ] 37 deps = [ 38 ":wire_protocol", 39 "../../gn:default_deps", 40 "../base", 41 ] 42 sources = [ 43 "buffered_frame_deserializer.cc", 44 "client_impl.cc", 45 "deferred.cc", 46 "host_impl.cc", 47 "host_impl.h", 48 "service_proxy.cc", 49 "virtual_destructors.cc", 50 ] 51} 52 53perfetto_fuzzer_test("buffered_frame_deserializer_fuzzer") { 54 sources = [ 55 "buffered_frame_deserializer_fuzzer.cc", 56 ] 57 deps = [ 58 ":ipc", 59 ":wire_protocol", 60 "../../gn:default_deps", 61 ] 62} 63 64source_set("unittests") { 65 testonly = true 66 deps = [ 67 ":ipc", 68 ":test_messages", 69 ":wire_protocol", 70 "../../gn:default_deps", 71 "../../gn:gtest_deps", 72 "../base", 73 "../base:test_support", 74 ] 75 sources = [ 76 "buffered_frame_deserializer_unittest.cc", 77 "client_impl_unittest.cc", 78 "deferred_unittest.cc", 79 "host_impl_unittest.cc", 80 "test/ipc_integrationtest.cc", 81 ] 82} 83 84proto_library("wire_protocol") { 85 generate_python = false 86 sources = [ 87 "wire_protocol.proto", 88 ] 89 proto_in_dir = perfetto_root_path 90 proto_out_dir = perfetto_root_path 91} 92 93ipc_library("test_messages") { 94 sources = [ 95 "test/client_unittest_messages.proto", 96 "test/deferred_unittest_messages.proto", 97 "test/greeter_service.proto", 98 ] 99 proto_in_dir = perfetto_root_path 100 proto_out_dir = perfetto_root_path 101} 102