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") |
| 16 | import("../../gn/proto_library.gni") |
| 17 | import("protozero_library.gni") |
| 18 | |
| 19 | source_set("protozero") { |
| 20 | public_configs = [ "../../gn:default_config" ] |
| 21 | public_deps = [ |
| 22 | "../../include/perfetto/protozero", |
| 23 | ] |
| 24 | deps = [ |
| 25 | "../../gn:default_deps", |
| 26 | "../../gn:gtest_prod_config", |
| 27 | "../base", |
| 28 | ] |
| 29 | sources = [ |
Hector Dearman | e1e56b6 | 2018-02-21 19:11:58 +0000 | [diff] [blame] | 30 | "message.cc", |
| 31 | "message_handle.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 32 | "proto_utils.cc", |
Hector Dearman | 9a5a0e9 | 2018-03-27 17:52:24 +0100 | [diff] [blame] | 33 | "scattered_stream_null_delegate.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 34 | "scattered_stream_writer.cc", |
| 35 | ] |
| 36 | } |
| 37 | |
Hector Dearman | 6cfec8a | 2018-03-14 16:54:09 +0000 | [diff] [blame] | 38 | source_set("unittests") { |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 39 | testonly = true |
| 40 | deps = [ |
| 41 | ":protozero", |
| 42 | ":testing_messages_lite", |
| 43 | ":testing_messages_zero", |
| 44 | "../../gn:default_deps", |
| 45 | "../../gn:gtest_deps", |
| 46 | "../base", |
| 47 | ] |
| 48 | sources = [ |
Hector Dearman | e1e56b6 | 2018-02-21 19:11:58 +0000 | [diff] [blame] | 49 | "message_handle_unittest.cc", |
| 50 | "message_unittest.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 51 | "proto_utils_unittest.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 52 | "scattered_stream_writer_unittest.cc", |
| 53 | "test/fake_scattered_buffer.cc", |
| 54 | "test/fake_scattered_buffer.h", |
| 55 | "test/protozero_conformance_unittest.cc", |
| 56 | ] |
| 57 | } |
| 58 | |
| 59 | # Generates both xxx.pbzero.h and xxx.pb.h (official proto). |
| 60 | |
| 61 | testing_proto_sources = [ |
| 62 | "test/example_proto/library.proto", |
| 63 | "test/example_proto/library_internals/galaxies.proto", |
| 64 | "test/example_proto/test_messages.proto", |
| 65 | "test/example_proto/upper_import.proto", |
| 66 | ] |
| 67 | |
| 68 | protozero_library("testing_messages_zero") { |
| 69 | sources = testing_proto_sources |
| 70 | proto_in_dir = perfetto_root_path |
Oystein Eftevaag | 51e06e5 | 2018-01-18 11:28:49 -0800 | [diff] [blame] | 71 | proto_out_dir = perfetto_root_path |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 72 | generator_plugin_options = "wrapper_namespace=pbzero" |
| 73 | } |
| 74 | |
| 75 | proto_library("testing_messages_lite") { |
Primiano Tucci | 20b760c | 2018-01-19 12:36:12 +0000 | [diff] [blame] | 76 | generate_python = false |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 77 | sources = testing_proto_sources |
| 78 | proto_in_dir = perfetto_root_path |
Oystein Eftevaag | 51e06e5 | 2018-01-18 11:28:49 -0800 | [diff] [blame] | 79 | proto_out_dir = perfetto_root_path |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 80 | } |