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 15 import("../../gn/perfetto.gni") 16 import("../../gn/ipc_library.gni") 17 import("../../gn/proto_library.gni") 18 19 # For use_libfuzzer. 20 if (!build_with_chromium) { 21 import("//gn/standalone/sanitizers/vars.gni") 22 } else { 23 import("//build/config/sanitizers/sanitizers.gni") 24 } 25 26 source_set("ipc") { 27 public_configs = [ "../../gn:default_config" ] 28 public_deps = [ 29 "../../include/perfetto/ipc", 30 ] 31 deps = [ 32 ":wire_protocol", 33 "../../gn:default_deps", 34 "../base", 35 ] 36 sources = [ 37 "buffered_frame_deserializer.cc", 38 "client_impl.cc", 39 "deferred.cc", 40 "host_impl.cc", 41 "host_impl.h", 42 "service_proxy.cc", 43 "unix_socket.cc", 44 "unix_socket.h", 45 "virtual_destructors.cc", 46 ] 47 } 48 49 if (use_libfuzzer) { 50 executable("buffered_frame_deserializer_fuzzer") { 51 sources = [ 52 "buffered_frame_deserializer_fuzzer.cc", 53 ] 54 deps = [ 55 ":ipc", 56 ":wire_protocol", 57 "../../gn:default_deps", 58 ] 59 configs += [ "../../gn:fuzzer_config" ] 60 } 61 } 62 63 source_set("unittests") { 64 testonly = true 65 deps = [ 66 ":ipc", 67 ":test_messages", 68 ":wire_protocol", 69 "../../gn:default_deps", 70 "../../gn:gtest_deps", 71 "../base", 72 "../base:test_support", 73 ] 74 sources = [ 75 "buffered_frame_deserializer_unittest.cc", 76 "client_impl_unittest.cc", 77 "deferred_unittest.cc", 78 "host_impl_unittest.cc", 79 "test/ipc_integrationtest.cc", 80 "unix_socket_unittest.cc", 81 ] 82 } 83 84 proto_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 93 ipc_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