blob: 9d7aa28d0aafbac9983589f983f50ee3cc619b80 [file] [log] [blame]
Alexei Frolovb7059712020-10-07 10:02:00 -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
15load(
16 "//pw_build:pigweed.bzl",
17 "pw_cc_library",
18 "pw_cc_test",
19)
20
21package(default_visibility = ["//visibility:public"])
22
23licenses(["notice"]) # Apache License 2.0
24
25pw_cc_library(
26 name = "method",
27 srcs = [
28 "raw_method.cc",
29 ],
30 hdrs = [
31 "public/pw_rpc/internal/raw_method.h",
32 ],
Nathaniel Broughb4f4e7a2021-05-06 14:49:55 +080033 includes = ["public"],
Alexei Frolovb7059712020-10-07 10:02:00 -070034 deps = [
35 "//pw_bytes",
Nathaniel Broughb4f4e7a2021-05-06 14:49:55 +080036 "//pw_rpc:internal_packet_pwpb",
Alexei Frolovb7059712020-10-07 10:02:00 -070037 "//pw_rpc:server",
Wyatt Heplere95bd722020-11-23 07:49:47 -080038 ],
Alexei Frolovb7059712020-10-07 10:02:00 -070039)
40
Alexei Frolova4d71502020-10-14 12:43:14 -070041pw_cc_library(
42 name = "method_union",
43 hdrs = [
44 "public/pw_rpc/internal/raw_method_union.h",
45 ],
46 deps = [
47 ":method",
Alexei Frolov8f553de2020-11-02 15:48:02 -080048 ],
Alexei Frolov8f553de2020-11-02 15:48:02 -080049)
50
51pw_cc_library(
52 name = "test_method_context",
53 hdrs = [
54 "public/pw_rpc/raw_test_method_context.h",
55 ],
56 deps = [
57 ":method_union",
58 "//pw_assert",
59 "//pw_containers",
Wyatt Heplere95bd722020-11-23 07:49:47 -080060 ],
Alexei Frolov8f553de2020-11-02 15:48:02 -080061)
62
Alexei Frolovb7059712020-10-07 10:02:00 -070063pw_cc_test(
Alexei Frolovc912ea72020-10-26 08:43:27 -070064 name = "codegen_test",
65 srcs = [
66 "codegen_test.cc",
67 ],
68 deps = [
69 ":method_union",
Nathaniel Broughb4f4e7a2021-05-06 14:49:55 +080070 ":test_method_context",
Alexei Frolovc912ea72020-10-26 08:43:27 -070071 "//pw_protobuf",
Nathaniel Broughb4f4e7a2021-05-06 14:49:55 +080072 "//pw_rpc:pw_rpc_test_pwpb",
Alexei Frolovc912ea72020-10-26 08:43:27 -070073 ],
74)
75
76pw_cc_test(
Alexei Frolovb7059712020-10-07 10:02:00 -070077 name = "raw_method_test",
78 srcs = [
79 "raw_method_test.cc",
80 ],
81 deps = [
Alexei Frolova4d71502020-10-14 12:43:14 -070082 ":method_union",
83 "//pw_protobuf",
84 "//pw_rpc:internal_test_utils",
Nathaniel Broughb4f4e7a2021-05-06 14:49:55 +080085 "//pw_rpc:pw_rpc_test_pwpb",
Alexei Frolova4d71502020-10-14 12:43:14 -070086 ],
87)
88
89pw_cc_test(
90 name = "raw_method_union_test",
91 srcs = [
92 "raw_method_union_test.cc",
93 ],
94 deps = [
95 ":method_union",
Alexei Frolovb7059712020-10-07 10:02:00 -070096 "//pw_protobuf",
97 "//pw_rpc:internal_test_utils",
Nathaniel Broughb4f4e7a2021-05-06 14:49:55 +080098 "//pw_rpc:pw_rpc_test_pwpb",
Alexei Frolovb7059712020-10-07 10:02:00 -070099 ],
100)
Wyatt Hepler8779bcd2020-11-25 07:25:16 -0800101
102pw_cc_test(
103 name = "stub_generation_test",
104 srcs = ["stub_generation_test.cc"],
Nathaniel Broughb4f4e7a2021-05-06 14:49:55 +0800105 deps = [
106 "//pw_rpc:pw_rpc_test_pwpb",
107 "//pw_rpc:server",
108 "//pw_rpc/raw:method_union",
109 ],
Wyatt Hepler8779bcd2020-11-25 07:25:16 -0800110)