Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / pigweed / repo / pw_rpc / CMakeLists.txt
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 include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
16 include($ENV{PW_ROOT}/pw_protobuf_compiler/proto.cmake)
17
18 if(NOT "${dir_pw_third_party_nanopb}" STREQUAL "")
19   add_subdirectory(nanopb)
20 endif()
21
22 add_subdirectory(raw)
23 add_subdirectory(system_server)
24
25 pw_add_module_library(pw_rpc.server
26   SOURCES
27     base_server_writer.cc
28     server.cc
29     service.cc
30   PUBLIC_DEPS
31     pw_rpc.common
32   PRIVATE_DEPS
33     pw_log
34 )
35
36 pw_add_module_library(pw_rpc.client
37   SOURCES
38     base_client_call.cc
39     client.cc
40   PUBLIC_DEPS
41     pw_rpc.common
42   PRIVATE_DEPS
43     pw_log
44 )
45
46 pw_add_module_library(pw_rpc.common
47   SOURCES
48     channel.cc
49     packet.cc
50   PUBLIC_DEPS
51     pw_assert
52     pw_bytes
53     pw_containers
54     pw_span
55     pw_status
56     pw_rpc.protos.pwpb
57   PRIVATE_DEPS
58     pw_log
59 )
60
61 pw_add_module_library(pw_rpc.synchronized_channel_output
62   PUBLIC_DEPS
63     pw_rpc.common
64     pw_sync.mutex
65 )
66
67 add_library(pw_rpc.test_utils INTERFACE)
68 target_include_directories(pw_rpc.test_utils INTERFACE .)
69
70 pw_proto_library(pw_rpc.protos
71   SOURCES
72     pw_rpc_protos/internal/packet.proto
73     pw_rpc_protos/echo.proto
74 )
75
76 pw_proto_library(pw_rpc.test_protos
77   SOURCES
78     pw_rpc_test_protos/test.proto
79 )
80
81 pw_auto_add_module_tests(pw_rpc
82   PRIVATE_DEPS
83     pw_rpc.client
84     pw_rpc.server
85 )