Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / pigweed / repo / pw_rpc / BUILD
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 load(
16     "//pw_build:pigweed.bzl",
17     "pw_cc_library",
18     "pw_cc_test",
19 )
20
21 package(default_visibility = ["//visibility:public"])
22
23 licenses(["notice"])  # Apache License 2.0
24
25 pw_cc_library(
26     name = "client",
27     srcs = [
28         "base_client_call.cc",
29         "client.cc",
30     ],
31     hdrs = [
32         "public/pw_rpc/client.h",
33         "public/pw_rpc/internal/base_client_call.h",
34     ],
35     deps = [
36         ":common",
37     ],
38 )
39
40 pw_cc_library(
41     name = "server",
42     srcs = [
43         "base_server_writer.cc",
44         "public/pw_rpc/internal/base_server_writer.h",
45         "public/pw_rpc/internal/call.h",
46         "public/pw_rpc/internal/hash.h",
47         "public/pw_rpc/internal/method.h",
48         "public/pw_rpc/internal/method_lookup.h",
49         "public/pw_rpc/internal/method_union.h",
50         "public/pw_rpc/internal/server.h",
51         "server.cc",
52         "service.cc",
53     ],
54     hdrs = [
55         "public/pw_rpc/server.h",
56         "public/pw_rpc/server_context.h",
57         "public/pw_rpc/service.h",
58     ],
59     includes = ["public"],
60     deps = [
61         ":common",
62     ],
63 )
64
65 pw_cc_library(
66     name = "common",
67     srcs = [
68         "channel.cc",
69         "packet.cc",
70         "public/pw_rpc/internal/channel.h",
71         "public/pw_rpc/internal/config.h",
72         "public/pw_rpc/internal/method_type.h",
73         "public/pw_rpc/internal/packet.h",
74     ],
75     hdrs = [
76         "public/pw_rpc/channel.h",
77     ],
78     includes = ["public"],
79     deps = [
80         "//pw_assert",
81         "//pw_log",
82         "//pw_span",
83         "//pw_status",
84     ],
85 )
86
87 pw_cc_library(
88     name = "synchronized_channel_output",
89     hdrs = ["public/pw_rpc/synchronized_channel_output.h"],
90     includes = ["public"],
91     deps = [
92         ":common",
93         "//pw_sync:mutex",
94     ],
95 )
96
97 pw_cc_library(
98     name = "internal_test_utils",
99     hdrs = [
100         "public/pw_rpc/internal/test_method.h",
101         "pw_rpc_private/internal_test_utils.h",
102         "pw_rpc_private/method_impl_tester.h",
103     ],
104     visibility = ["//visibility:private"],
105     deps = [
106         ":server",
107         "//pw_span",
108     ],
109 )
110
111 # TODO(hepler): Cannot build nanopb-dependent code in Bazel at the moment. Need
112 # to determine how best to support Nanopb builds and protobuf generation.
113 filegroup(
114     name = "nanopb",
115     srcs = [
116         "nanopb/codegen_test.cc",
117         "nanopb/echo_service_test.cc",
118         "nanopb/method_lookup_test.cc",
119         "nanopb/nanopb_client_call.cc",
120         "nanopb/nanopb_client_call_test.cc",
121         "nanopb/nanopb_common.cc",
122         "nanopb/nanopb_method.cc",
123         "nanopb/nanopb_method_test.cc",
124         "nanopb/nanopb_method_union_test.cc",
125         "nanopb/public/pw_rpc/echo_service_nanopb.h",
126         "nanopb/public/pw_rpc/internal/nanopb_common.h",
127         "nanopb/public/pw_rpc/internal/nanopb_method.h",
128         "nanopb/public/pw_rpc/internal/nanopb_method_union.h",
129         "nanopb/public/pw_rpc/nanopb_client_call.h",
130         "nanopb/public/pw_rpc/nanopb_test_method_context.h",
131         "nanopb/pw_rpc_nanopb_private/internal_test_utils.h",
132         "nanopb/stub_generation_test.cc",
133     ],
134 )
135
136 pw_cc_test(
137     name = "base_server_writer_test",
138     srcs = [
139         "base_server_writer_test.cc",
140     ],
141     deps = [
142         ":internal_test_utils",
143         ":server",
144     ],
145 )
146
147 pw_cc_test(
148     name = "base_client_call_test",
149     srcs = [
150         "base_client_call_test.cc",
151     ],
152     deps = [
153         ":client",
154         ":internal_test_utils",
155     ],
156 )
157
158 pw_cc_test(
159     name = "client_test",
160     srcs = [
161         "client_test.cc",
162     ],
163     deps = [
164         ":client",
165         ":internal_test_utils",
166     ],
167 )
168
169 pw_cc_test(
170     name = "channel_test",
171     srcs = ["channel_test.cc"],
172     deps = [
173         ":server",
174         ":test_utils_test_server",
175     ],
176 )
177
178 pw_cc_test(
179     name = "packet_test",
180     srcs = [
181         "packet_test.cc",
182     ],
183     deps = [
184         ":server",
185     ],
186 )
187
188 proto_library(
189     name = "packet_proto",
190     srcs = [
191         "pw_rpc_protos/internal/packet.proto",
192     ],
193 )
194
195 pw_cc_test(
196     name = "server_test",
197     srcs = [
198         "server_test.cc",
199     ],
200     deps = [
201         ":internal_test_utils",
202         ":server",
203         "//pw_assert",
204     ],
205 )
206
207 pw_cc_test(
208     name = "service_test",
209     srcs = [
210         "service_test.cc",
211     ],
212     deps = [
213         ":internal_test_utils",
214         ":server",
215         "//pw_assert",
216     ],
217 )