Skip to content

Commit

Permalink
pw_rpc: Add the pw_rpc config to CMake
Browse files Browse the repository at this point in the history
- Add the pw_rpc_CONFIG module configuration to the CMake build.
- Add pw_rpc.disable_global_mutex_config to simplify disabling the
  global pw_rpc mutex in CMake.

Change-Id: I0a776c4c8f5dde7c21b2eb0fd72070d1da268705
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/96202
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
  • Loading branch information
255 authored and CQ Bot Account committed May 27, 2022
1 parent fdc2388 commit 27c328e
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion pw_rpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ add_subdirectory(pwpb)
add_subdirectory(raw)
add_subdirectory(system_server)

pw_add_module_config(pw_rpc_CONFIG)

pw_add_module_library(pw_rpc.config
HEADERS
public/pw_rpc/internal/config.h
PUBLIC_INCLUDES
public
PUBLIC_DEPS
${pw_rpc_CONFIG}
)

pw_add_module_library(pw_rpc.server
SOURCES
call.cc
Expand Down Expand Up @@ -85,10 +96,11 @@ pw_add_module_library(pw_rpc.common
pw_bytes
pw_containers
pw_function
pw_rpc.config
pw_rpc.protos.pwpb
pw_span
pw_status
pw_sync.lock_annotations
pw_rpc.protos.pwpb
PRIVATE_DEPS
pw_log
)
Expand Down Expand Up @@ -129,6 +141,13 @@ pw_proto_library(pw_rpc.test_protos
pw_rpc_test_protos/test.proto
)

# Set pw_rpc_CONFIG to this to disable the global mutex.
add_library(pw_rpc.disable_global_mutex_config INTERFACE)
target_compile_definitions(pw_rpc.disable_global_mutex_config
INTERFACE
PW_RPC_USE_GLOBAL_MUTEX=0
)

pw_auto_add_module_tests(pw_rpc
PRIVATE_DEPS
pw_rpc.client
Expand Down

0 comments on commit 27c328e

Please sign in to comment.