Alexei Frolov | 26e3ae6 | 2020-05-04 17:06:17 -0700 | [diff] [blame] | 1 | # Copyright 2020 The Pigweed Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | # use this file except in compliance with the License. You may obtain a copy of |
| 5 | # the License at |
| 6 | # |
| 7 | # https://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, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations under |
| 13 | # the License. |
| 14 | |
| 15 | import("$dir_pw_docgen/docs.gni") |
Alexei Frolov | 5d6d392 | 2020-05-08 13:57:02 -0700 | [diff] [blame^] | 16 | import("$dir_pw_protobuf_compiler/proto.gni") |
Alexei Frolov | 26e3ae6 | 2020-05-04 17:06:17 -0700 | [diff] [blame] | 17 | import("$dir_pw_unit_test/test.gni") |
| 18 | |
| 19 | config("default_config") { |
| 20 | include_dirs = [ "public" ] |
| 21 | } |
| 22 | |
| 23 | source_set("pw_rpc") { |
Alexei Frolov | 5d6d392 | 2020-05-08 13:57:02 -0700 | [diff] [blame^] | 24 | deps = [ ":protos_pwpb" ] |
Alexei Frolov | 26e3ae6 | 2020-05-04 17:06:17 -0700 | [diff] [blame] | 25 | public_configs = [ ":default_config" ] |
| 26 | public_deps = [ |
| 27 | dir_pw_assert, |
Alexei Frolov | 5d6d392 | 2020-05-08 13:57:02 -0700 | [diff] [blame^] | 28 | dir_pw_log, |
Alexei Frolov | 26e3ae6 | 2020-05-04 17:06:17 -0700 | [diff] [blame] | 29 | dir_pw_span, |
Alexei Frolov | 5d6d392 | 2020-05-08 13:57:02 -0700 | [diff] [blame^] | 30 | dir_pw_status, |
Alexei Frolov | 26e3ae6 | 2020-05-04 17:06:17 -0700 | [diff] [blame] | 31 | ] |
| 32 | public = [ |
| 33 | "public/pw_rpc/channel.h", |
| 34 | "public/pw_rpc/server.h", |
| 35 | ] |
Alexei Frolov | 5d6d392 | 2020-05-08 13:57:02 -0700 | [diff] [blame^] | 36 | sources = [ |
| 37 | "channel.cc", |
| 38 | "packet.cc", |
| 39 | "public/pw_rpc/internal/packet.h", |
| 40 | "public/pw_rpc/internal/service.h", |
| 41 | "public/pw_rpc/internal/service_registry.h", |
| 42 | "server.cc", |
| 43 | "service.cc", |
| 44 | "service_registry.cc", |
| 45 | ] |
| 46 | friend = [ ":*" ] |
| 47 | } |
| 48 | |
| 49 | pw_proto_library("protos") { |
| 50 | sources = [ "pw_rpc_protos/packet.proto" ] |
Alexei Frolov | 26e3ae6 | 2020-05-04 17:06:17 -0700 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | pw_doc_group("docs") { |
| 54 | sources = [ "docs.rst" ] |
| 55 | } |
| 56 | |
| 57 | pw_test_group("tests") { |
Alexei Frolov | 5d6d392 | 2020-05-08 13:57:02 -0700 | [diff] [blame^] | 58 | tests = [ |
| 59 | ":packet_test", |
| 60 | ":server_test", |
| 61 | ] |
Alexei Frolov | 26e3ae6 | 2020-05-04 17:06:17 -0700 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | pw_test("server_test") { |
| 65 | deps = [ ":pw_rpc" ] |
| 66 | sources = [ "server_test.cc" ] |
| 67 | } |
Alexei Frolov | 5d6d392 | 2020-05-08 13:57:02 -0700 | [diff] [blame^] | 68 | |
| 69 | pw_test("packet_test") { |
| 70 | deps = [ |
| 71 | ":pw_rpc", |
| 72 | dir_pw_protobuf, |
| 73 | ] |
| 74 | sources = [ "packet_test.cc" ] |
| 75 | } |