Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 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") |
Primiano Tucci | 114b649 | 2017-12-11 23:09:45 +0000 | [diff] [blame] | 16 | import("../../gn/ipc_library.gni") |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 17 | import("../../gn/proto_library.gni") |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 18 | |
Florian Mayer | 94aaf69 | 2018-01-29 16:29:02 +0000 | [diff] [blame] | 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 | |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 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", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 45 | "virtual_destructors.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 46 | ] |
| 47 | } |
| 48 | |
Florian Mayer | 00b6db5 | 2018-01-22 14:22:39 +0000 | [diff] [blame] | 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", |
Florian Mayer | 3a3974e | 2018-01-24 11:37:29 +0000 | [diff] [blame] | 57 | "../../gn:default_deps", |
Florian Mayer | 00b6db5 | 2018-01-22 14:22:39 +0000 | [diff] [blame] | 58 | ] |
Florian Mayer | 3a3974e | 2018-01-24 11:37:29 +0000 | [diff] [blame] | 59 | configs += [ "../../gn:fuzzer_config" ] |
Florian Mayer | 00b6db5 | 2018-01-22 14:22:39 +0000 | [diff] [blame] | 60 | } |
| 61 | } |
| 62 | |
Hector Dearman | 6cfec8a | 2018-03-14 16:54:09 +0000 | [diff] [blame] | 63 | source_set("unittests") { |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 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") { |
Primiano Tucci | 20b760c | 2018-01-19 12:36:12 +0000 | [diff] [blame] | 85 | generate_python = false |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 86 | sources = [ |
| 87 | "wire_protocol.proto", |
| 88 | ] |
| 89 | proto_in_dir = perfetto_root_path |
Oystein Eftevaag | 51e06e5 | 2018-01-18 11:28:49 -0800 | [diff] [blame] | 90 | proto_out_dir = perfetto_root_path |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 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 |
Primiano Tucci | 20b760c | 2018-01-19 12:36:12 +0000 | [diff] [blame] | 100 | proto_out_dir = perfetto_root_path |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 101 | } |