Skip to content

Commit

Permalink
pw_system: Remove target_hooks_multiplexer
Browse files Browse the repository at this point in the history
Bug: 347998044
Change-Id: I24d94d2d4dad09be32ed7bf2b2ab622de7332004
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/220119
Reviewed-by: Erik Gilling <[email protected]>
Docs-Not-Needed: Ted Pudlik <[email protected]>
Pigweed-Auto-Submit: Ted Pudlik <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Lint: Lint 🤖 <[email protected]>
  • Loading branch information
tpudlik authored and CQ Bot Account committed Dec 26, 2024
1 parent bb41eea commit be3a9d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
20 changes: 7 additions & 13 deletions pw_system/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_python//python:proto.bzl", "py_proto_library")
load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library")
load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
load("//pw_build:compatibility.bzl", "host_backend_alias", "incompatible_with_mcu")
load("//pw_build:pw_cc_binary.bzl", "pw_cc_binary")
load("//pw_build:pw_facade.bzl", "pw_facade")
load(
Expand Down Expand Up @@ -511,19 +511,12 @@ cc_library(

label_flag(
name = "target_hooks_backend",
build_setting_default = ":target_hooks_multiplexer",
build_setting_default = ":unspecified_target_hooks",
)

# 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.
cc_library(
name = "target_hooks_multiplexer",
visibility = ["//targets:__pkg__"],
deps = select({
"//pw_build/constraints/rtos:freertos": [":freertos_target_hooks"],
"//conditions:default": [":stl_target_hooks"],
}),
host_backend_alias(
name = "unspecified_target_hooks",
backend = ":stl_target_hooks",
)

cc_library(
Expand All @@ -547,14 +540,15 @@ cc_library(
hdrs = [
"public/pw_system/target_hooks.h",
],
strip_include_prefix = "public",
includes = ["public"],
target_compatible_with = [
"//pw_build/constraints/rtos:freertos",
],
deps = [
":config",
"//pw_thread:thread",
"//pw_thread_freertos:thread",
"@freertos",
],
)

Expand Down
1 change: 1 addition & 0 deletions third_party/freertos/flags.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ FREERTOS_FLAGS = {
str(Label("//pw_sync:thread_notification_backend")): str(Label("//pw_sync_freertos:thread_notification")),
str(Label("//pw_sync:timed_mutex_backend")): str(Label("//pw_sync_freertos:timed_mutex")),
str(Label("//pw_sync:timed_thread_notification_backend")): str(Label("//pw_sync_freertos:timed_thread_notification")),
str(Label("//pw_system:target_hooks_backend")): str(Label("//pw_system:freertos_target_hooks")),
str(Label("//pw_thread:id_backend")): str(Label("//pw_thread_freertos:id")),
str(Label("//pw_thread:iteration_backend")): str(Label("//pw_thread_freertos:thread_iteration")),
str(Label("//pw_thread:sleep_backend")): str(Label("//pw_thread_freertos:sleep")),
Expand Down

0 comments on commit be3a9d7

Please sign in to comment.