aboutsummaryrefslogtreecommitdiff
path: root/pw_system/BUILD.bazel
diff options
context:
space:
mode:
Diffstat (limited to 'pw_system/BUILD.bazel')
-rw-r--r--pw_system/BUILD.bazel81
1 files changed, 68 insertions, 13 deletions
diff --git a/pw_system/BUILD.bazel b/pw_system/BUILD.bazel
index 0a16c5722..d9fb2e97c 100644
--- a/pw_system/BUILD.bazel
+++ b/pw_system/BUILD.bazel
@@ -22,10 +22,6 @@ package(default_visibility = ["//visibility:public"])
licenses(["notice"])
-# WARNING: Many of the dependencies in this file are missing and need to be
-# added/updated. This is provided as a starting point, but currently does not
-# work.
-
pw_cc_library(
name = "config",
hdrs = [
@@ -66,7 +62,9 @@ pw_cc_library(
"//pw_log:facade",
"//pw_log:proto_utils",
"//pw_log_string:handler_facade",
- "//pw_log_tokenized:metadata",
+ "//pw_log_tokenized:handler_facade",
+ "//pw_log_tokenized:headers",
+ "//pw_metric:global",
"//pw_multisink",
"//pw_result",
"//pw_string",
@@ -77,14 +75,22 @@ pw_cc_library(
)
pw_cc_library(
- name = "rpc_server",
+ name = "rpc_server_headers",
hdrs = [
"public/pw_system/rpc_server.h",
],
includes = ["public"],
deps = [
":config",
+ ],
+)
+
+pw_cc_library(
+ name = "rpc_server",
+ deps = [
+ ":config",
":hdlc_rpc_server",
+ ":rpc_server_headers",
],
)
@@ -96,7 +102,7 @@ pw_cc_library(
includes = ["public"],
deps = [
":io",
- ":rpc_server",
+ ":rpc_server_headers",
":target_io",
"//pw_assert",
"//pw_hdlc:pw_rpc",
@@ -107,6 +113,21 @@ pw_cc_library(
)
pw_cc_library(
+ name = "thread_snapshot_service",
+ srcs = [
+ "thread_snapshot_service.cc",
+ ],
+ hdrs = [
+ "public/pw_system/thread_snapshot_service.h",
+ ],
+ includes = ["public"],
+ deps = [
+ "//pw_rpc",
+ "//pw_thread:thread_snapshot_service",
+ ],
+)
+
+pw_cc_library(
name = "io",
hdrs = [
"public/pw_system/io.h",
@@ -128,7 +149,12 @@ pw_cc_library(
deps = [
":log",
":rpc_server",
- "//pw_rpc/nanopb:echo_service",
+ ":target_hooks",
+ ":thread_snapshot_service",
+ ":work_queue",
+ "//pw_metric:global",
+ "//pw_metric:metric_service_pwpb",
+ "//pw_rpc/pwpb:echo_service",
"//pw_thread:thread",
],
)
@@ -143,6 +169,7 @@ pw_cc_library(
],
includes = ["public"],
deps = [
+ ":config",
"//pw_work_queue",
],
)
@@ -176,6 +203,17 @@ pw_cc_library(
)
pw_cc_library(
+ name = "target_hooks_headers",
+ hdrs = [
+ "public/pw_system/target_hooks.h",
+ ],
+ includes = ["public"],
+ deps = [
+ "//pw_thread:thread",
+ ],
+)
+
+pw_cc_library(
name = "target_hooks",
hdrs = [
"public/pw_system/target_hooks.h",
@@ -183,16 +221,28 @@ pw_cc_library(
includes = ["public"],
deps = [
"//pw_thread:thread",
+ "@pigweed_config//:pw_system_target_hooks_backend",
],
)
+# This isn't the best solution, but it's close enough for now. Target hooks are
+# not generically related to an OS, and should be inject-able by downstream
+# projects. For now, assume the pre-baked OS-specific hooks are good enough.
+pw_cc_library(
+ name = "target_hooks_multiplexer",
+ visibility = ["@pigweed_config//:__pkg__"],
+ deps = select({
+ "//pw_build/constraints/rtos:freertos": [":freertos_target_hooks"],
+ "//conditions:default": [":stl_target_hooks"],
+ }),
+)
+
pw_cc_library(
name = "stl_target_hooks",
srcs = [
"stl_target_hooks.cc",
],
deps = [
- "//pw_thread:sleep",
"//pw_thread:thread",
"//pw_thread_stl:thread",
],
@@ -203,10 +253,11 @@ pw_cc_library(
srcs = [
"freertos_target_hooks.cc",
],
-
- # TODO(pwbug/317): This should depend on FreeRTOS but our third parties
- # currently do not have Bazel support.
+ target_compatible_with = [
+ "//pw_build/constraints/rtos:freertos",
+ ],
deps = [
+ ":target_hooks_headers",
"//pw_thread:thread",
"//pw_thread_freertos:thread",
],
@@ -221,5 +272,9 @@ pw_cc_binary(
":target_hooks",
"//pw_stream",
"//pw_stream:sys_io_stream",
- ],
+ "//pw_unit_test:rpc_service",
+ ] + select({
+ "//pw_build/constraints/rtos:freertos": [],
+ "//conditions:default": ["//targets/host_device_simulator:boot"],
+ }),
)