Skip to content

Commit

Permalink
pw_assert: Remove backend multiplexer
Browse files Browse the repository at this point in the history
Bug: 347998044
Change-Id: Ieddc9fd4f10e107ca92836432e742003ee62ddc8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/215914
Reviewed-by: Taylor Cramer <[email protected]>
Lint: Lint 🤖 <[email protected]>
Commit-Queue: Ted Pudlik <[email protected]>
  • Loading branch information
tpudlik authored and CQ Bot Account committed Jun 26, 2024
1 parent ef4e6e1 commit e9f1167
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
6 changes: 6 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ common --//pw_env_setup/py:pigweed_json=//:pigweed.json
#
# TODO: b/301334234 - Make the platform set the flags below.
build:rp2040 --platforms=@pigweed//targets/rp2040
build:rp2040 --//pw_assert:backend=@pigweed//pw_assert_basic
build:rp2040 --//pw_assert:backend_impl=@pigweed//pw_assert_basic:impl
build:rp2040 --//pw_interrupt:backend=@pigweed//pw_interrupt_cortex_m:context
build:rp2040 --//pw_log:backend=@pigweed//pw_log_tokenized
build:rp2040 --//pw_log:backend_impl=@pigweed//pw_log_tokenized:impl
Expand All @@ -147,6 +149,8 @@ test:rp2040 --run_under=//targets/rp2040/py:unit_test_client
#
# TODO: b/301334234 - Make the platform set the flags below.
build:stm32f429i_baremetal --platforms=//targets/stm32f429i_disc1:platform
build:stm32f429i_baremetal --//pw_assert:backend=@pigweed//pw_assert_basic
build:stm32f429i_baremetal --//pw_assert:backend_impl=@pigweed//pw_assert_basic:impl
build:stm32f429i_baremetal --//pw_boot:backend=@pigweed//pw_boot_cortex_m
build:stm32f429i_baremetal --//pw_log:backend=@pigweed//pw_log_basic
build:stm32f429i_baremetal --//pw_log:backend_impl=@pigweed//pw_log_basic:impl
Expand All @@ -161,6 +165,8 @@ build:stm32f429i_freertos --platforms=//targets/stm32f429i_disc1_stm32cube:platf
build:stm32f429i_freertos --copt="-DSTM32CUBE_HEADER=\"stm32f4xx.h\""
build:stm32f429i_freertos --copt="-DSTM32F429xx"
build:stm32f429i_freertos --@stm32f4xx_hal_driver//:hal_config=//targets/stm32f429i_disc1_stm32cube:hal_config
build:stm32f429i_freertos --//pw_assert:backend=@pigweed//pw_assert_basic
build:stm32f429i_freertos --//pw_assert:backend_impl=@pigweed//pw_assert_basic:impl
build:stm32f429i_freertos --//pw_boot:backend=@pigweed//pw_boot_cortex_m
build:stm32f429i_freertos --//pw_log:backend=@pigweed//pw_log_tokenized
build:stm32f429i_freertos --//pw_log:backend_impl=@pigweed//pw_log_tokenized:impl
Expand Down
29 changes: 13 additions & 16 deletions pw_assert/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations under
# the License.

load("//pw_build:compatibility.bzl", "host_backend_alias")
load(
"//pw_build:pigweed.bzl",
"pw_cc_test",
Expand Down Expand Up @@ -48,16 +49,26 @@ pw_facade(

label_flag(
name = "backend",
build_setting_default = ":backend_multiplexer",
build_setting_default = ":unspecified_backend",
)

host_backend_alias(
name = "unspecified_backend",
backend = "//pw_assert_basic",
)

label_flag(
name = "backend_impl",
build_setting_default = ":backend_impl_multiplexer",
build_setting_default = ":unspecified_backend_impl",
# For internal tooling: go/build-cleaner/troubleshooting-faq#keep-dep
tags = ["keep_dep"],
)

host_backend_alias(
name = "unspecified_backend_impl",
backend = "@pigweed//pw_assert_basic:impl",
)

cc_library(
name = "config",
hdrs = ["public/pw_assert/config.h"],
Expand Down Expand Up @@ -130,20 +141,6 @@ cc_library(
],
)

cc_library(
name = "backend_multiplexer",
visibility = ["@pigweed//targets:__pkg__"],
deps = [
"@pigweed//pw_assert_basic",
],
)

alias(
name = "backend_impl_multiplexer",
actual = "@pigweed//pw_assert_basic:impl",
visibility = ["@pigweed//targets:__pkg__"],
)

pw_cc_test(
name = "assert_facade_test",
srcs = [
Expand Down
4 changes: 4 additions & 0 deletions targets/rp2040/transition.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def _rp2040_transition_impl(settings, attr):
"@freertos//:freertos_config": "@pigweed//targets/rp2040:freertos_config",
"@pico-sdk//bazel/config:PICO_STDIO_UART": True,
"@pico-sdk//bazel/config:PICO_STDIO_USB": True,
"@pigweed//pw_assert:backend": "@pigweed//pw_assert_basic",
"@pigweed//pw_assert:backend_impl": "@pigweed//pw_assert_basic:impl",
"@pigweed//pw_interrupt:backend": "@pigweed//pw_interrupt_cortex_m:context",
"@pigweed//pw_log:backend": "@pigweed//pw_log_tokenized",
"@pigweed//pw_log:backend_impl": "@pigweed//pw_log_tokenized:impl",
Expand All @@ -35,6 +37,8 @@ _rp2040_transition = transition(
inputs = [],
outputs = [
"//command_line_option:platforms",
"@pigweed//pw_assert:backend",
"@pigweed//pw_assert:backend_impl",
"@pigweed//pw_interrupt:backend",
"@pigweed//pw_log:backend",
"@pigweed//pw_log:backend_impl",
Expand Down

0 comments on commit e9f1167

Please sign in to comment.