blob: 192a9bc4a272ff78cb4f19686735c097b8b34b04 [file] [log] [blame]
Alexei Frolov26e3ae62020-05-04 17:06:17 -07001# 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
15import("$dir_pw_docgen/docs.gni")
Alexei Frolov5d6d3922020-05-08 13:57:02 -070016import("$dir_pw_protobuf_compiler/proto.gni")
Alexei Frolov26e3ae62020-05-04 17:06:17 -070017import("$dir_pw_unit_test/test.gni")
18
19config("default_config") {
20 include_dirs = [ "public" ]
21}
22
23source_set("pw_rpc") {
Alexei Frolov5d6d3922020-05-08 13:57:02 -070024 deps = [ ":protos_pwpb" ]
Alexei Frolov26e3ae62020-05-04 17:06:17 -070025 public_configs = [ ":default_config" ]
26 public_deps = [
27 dir_pw_assert,
Alexei Frolov5d6d3922020-05-08 13:57:02 -070028 dir_pw_log,
Alexei Frolov26e3ae62020-05-04 17:06:17 -070029 dir_pw_span,
Alexei Frolov5d6d3922020-05-08 13:57:02 -070030 dir_pw_status,
Alexei Frolov26e3ae62020-05-04 17:06:17 -070031 ]
32 public = [
33 "public/pw_rpc/channel.h",
34 "public/pw_rpc/server.h",
35 ]
Alexei Frolov5d6d3922020-05-08 13:57:02 -070036 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
49pw_proto_library("protos") {
50 sources = [ "pw_rpc_protos/packet.proto" ]
Alexei Frolov26e3ae62020-05-04 17:06:17 -070051}
52
53pw_doc_group("docs") {
54 sources = [ "docs.rst" ]
55}
56
57pw_test_group("tests") {
Alexei Frolov5d6d3922020-05-08 13:57:02 -070058 tests = [
59 ":packet_test",
60 ":server_test",
61 ]
Alexei Frolov26e3ae62020-05-04 17:06:17 -070062}
63
64pw_test("server_test") {
65 deps = [ ":pw_rpc" ]
66 sources = [ "server_test.cc" ]
67}
Alexei Frolov5d6d3922020-05-08 13:57:02 -070068
69pw_test("packet_test") {
70 deps = [
71 ":pw_rpc",
72 dir_pw_protobuf,
73 ]
74 sources = [ "packet_test.cc" ]
75}