blob: 69c320c1f17d4114477e2265fe36677d5573bf4b [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
15import("../../gn/perfetto.gni")
Primiano Tucci114b6492017-12-11 23:09:45 +000016import("../../gn/ipc_library.gni")
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000017import("../../gn/proto_library.gni")
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000018
Florian Mayer94aaf692018-01-29 16:29:02 +000019# For use_libfuzzer.
20if (!build_with_chromium) {
21 import("//gn/standalone/sanitizers/vars.gni")
22} else {
23 import("//build/config/sanitizers/sanitizers.gni")
24}
25
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000026source_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",
Primiano Tucci3cbb10a2018-04-10 17:52:40 +010045 "virtual_destructors.cc",
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000046 ]
47}
48
Florian Mayer00b6db52018-01-22 14:22:39 +000049if (use_libfuzzer) {
50 executable("buffered_frame_deserializer_fuzzer") {
51 sources = [
52 "buffered_frame_deserializer_fuzzer.cc",
53 ]
54 deps = [
55 ":ipc",
56 ":wire_protocol",
Florian Mayer3a3974e2018-01-24 11:37:29 +000057 "../../gn:default_deps",
Florian Mayer00b6db52018-01-22 14:22:39 +000058 ]
Florian Mayer3a3974e2018-01-24 11:37:29 +000059 configs += [ "../../gn:fuzzer_config" ]
Florian Mayer00b6db52018-01-22 14:22:39 +000060 }
61}
62
Hector Dearman6cfec8a2018-03-14 16:54:09 +000063source_set("unittests") {
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000064 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
84proto_library("wire_protocol") {
Primiano Tucci20b760c2018-01-19 12:36:12 +000085 generate_python = false
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000086 sources = [
87 "wire_protocol.proto",
88 ]
89 proto_in_dir = perfetto_root_path
Oystein Eftevaag51e06e52018-01-18 11:28:49 -080090 proto_out_dir = perfetto_root_path
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000091}
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
Primiano Tucci20b760c2018-01-19 12:36:12 +0000100 proto_out_dir = perfetto_root_path
Primiano Tucci4f9b6d72017-12-05 20:59:16 +0000101}