Skip to content

Commit

Permalink
pw_rpc_transport: Add CMake support
Browse files Browse the repository at this point in the history
Change-Id: I0bee6928e88e131a158673109baaa2f3bf660128
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/148290
Presubmit-Verified: CQ Bot Account <[email protected]>
Commit-Queue: Oleg Shaldybin <[email protected]>
Reviewed-by: Carlos Chinchilla <[email protected]>
  • Loading branch information
olegshaldybin authored and CQ Bot Account committed May 22, 2023
1 parent f711cd8 commit fd9280b
Show file tree
Hide file tree
Showing 2 changed files with 208 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ add_subdirectory(pw_result EXCLUDE_FROM_ALL)
add_subdirectory(pw_ring_buffer EXCLUDE_FROM_ALL)
add_subdirectory(pw_router EXCLUDE_FROM_ALL)
add_subdirectory(pw_rpc EXCLUDE_FROM_ALL)
add_subdirectory(pw_rpc_transport EXCLUDE_FROM_ALL)
add_subdirectory(pw_snapshot EXCLUDE_FROM_ALL)
add_subdirectory(pw_span EXCLUDE_FROM_ALL)
add_subdirectory(pw_status EXCLUDE_FROM_ALL)
Expand Down
207 changes: 207 additions & 0 deletions pw_rpc_transport/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
# Copyright 2023 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
include($ENV{PW_ROOT}/pw_protobuf_compiler/proto.cmake)

pw_add_library(pw_rpc_transport.rpc_transport INTERFACE
HEADERS
public/pw_rpc_transport/rpc_transport.h
PUBLIC_INCLUDES
public
PUBLIC_DEPS
pw_bytes
pw_function
pw_status
)

pw_add_library(pw_rpc_transport.service_registry INTERFACE
HEADERS
public/pw_rpc_transport/service_registry.h
PUBLIC_INCLUDES
public
PUBLIC_DEPS
pw_rpc_transport.rpc_transport
pw_rpc.client_server
pw_span
pw_status
)

pw_add_library(pw_rpc_transport.packet_buffer_queue INTERFACE
HEADERS
public/pw_rpc_transport/internal/packet_buffer_queue.h
PUBLIC_INCLUDES
public
PUBLIC_DEPS
pw_bytes
pw_containers
pw_result
pw_status
pw_sync.lock_annotations
pw_sync.mutex
)

pw_add_test(pw_rpc_transport.packet_buffer_queue_test
SOURCES
internal/packet_buffer_queue_test.cc
PRIVATE_DEPS
pw_rpc_transport.packet_buffer_queue
pw_bytes
pw_containers
pw_result
pw_status
pw_sync.lock_annotations
pw_sync.mutex
GROUPS
modules
pw_rpc_transport
)

pw_add_library(pw_rpc_transport.local_rpc_egress STATIC
HEADERS
public/pw_rpc_transport/local_rpc_egress.h
SOURCES
local_rpc_egress.cc
PUBLIC_INCLUDES
public
PUBLIC_DEPS
pw_rpc_transport.packet_buffer_queue
pw_rpc_transport.rpc_transport
pw_bytes
pw_result
pw_rpc.client
pw_status
pw_sync.thread_notification
pw_thread.thread_core
PRIVATE_DEPS
pw_log
)

pw_add_test(pw_rpc_transport.local_rpc_egress_test
SOURCES
local_rpc_egress_test.cc
PRIVATE_DEPS
pw_rpc_transport.local_rpc_egress
pw_rpc_transport.rpc_transport
pw_rpc_transport.service_registry
pw_rpc_transport.test_protos.pwpb_rpc
pw_bytes
pw_chrono.system_clock
pw_rpc.client_server
pw_status
pw_sync.counting_semaphore
pw_sync.thread_notification
pw_thread.sleep
pw_thread.thread
GROUPS
modules
pw_rpc_transport
)

pw_add_library(pw_rpc_transport.hdlc_framing INTERFACE
HEADERS
public/pw_rpc_transport/hdlc_framing.h
PUBLIC_INCLUDES
public
PUBLIC_DEPS
pw_rpc_transport.rpc_transport
pw_bytes
pw_hdlc.decoder
pw_hdlc.encoder
pw_result
pw_status
pw_stream
)

pw_add_test(pw_rpc_transport.hdlc_framing_test
SOURCES
hdlc_framing_test.cc
PRIVATE_DEPS
pw_rpc_transport.hdlc_framing
pw_bytes
pw_status
GROUPS
modules
pw_rpc_transport
)

pw_add_library(pw_rpc_transport.simple_framing STATIC
HEADERS
public/pw_rpc_transport/simple_framing.h
SOURCES
simple_framing.cc
PUBLIC_INCLUDES
public
PUBLIC_DEPS
pw_rpc_transport.rpc_transport
pw_assert
pw_bytes
pw_status
PRIVATE_DEPS
pw_log
)

pw_add_test(pw_rpc_transport.simple_framing_test
SOURCES
simple_framing_test.cc
PRIVATE_DEPS
pw_rpc_transport.simple_framing
pw_bytes
pw_log
pw_status
GROUPS
modules
pw_rpc_transport
)

pw_add_library(pw_rpc_transport.egress_ingress STATIC
HEADERS
public/pw_rpc_transport/egress_ingress.h
SOURCES
egress_ingress.cc
PUBLIC_DEPS
pw_rpc_transport.hdlc_framing
pw_rpc_transport.simple_framing
pw_bytes
pw_metric
pw_rpc.client
pw_status
PRIVATE_DEPS
pw_log
)

pw_add_test(pw_rpc_transport.egress_ingress_test
SOURCES
egress_ingress_test.cc
PRIVATE_DEPS
pw_rpc_transport.egress_ingress
pw_rpc_transport.service_registry
pw_rpc_transport.test_protos.pwpb_rpc
pw_bytes
pw_metric
pw_status
pw_sync.thread_notification
GROUPS
modules
pw_rpc_transport
)

pw_proto_library(pw_rpc_transport.test_protos
SOURCES
internal/test.proto
INPUTS
internal/test.options
PREFIX
pw_rpc_transport
)

0 comments on commit fd9280b

Please sign in to comment.