diff options
author | Ted Pudlik <tpudlik@google.com> | 2023-10-26 21:25:35 +0000 |
---|---|---|
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-10-26 21:25:35 +0000 |
commit | 459a1826957c35a6c47d74580ed0778c758b1598 (patch) | |
tree | 0346cb86dff5ae8911e90a427e2fa1b3bcd6f549 /pw_build | |
parent | 94e41edc059dd6c03ddef6b86d26cbb8232ddabf (diff) | |
download | pigweed-459a1826957c35a6c47d74580ed0778c758b1598.tar.gz |
pw_log: Introduce backend_impl label flag
This is analogous to the flag introduced for pw_assert in pwrev/168774.
By placing the log handler implementation in this target, which all
binaries are expected to directly depend on, we can avoid circular
dependencies.
This fixes the Bazel build for pw_log_tokenized, which previously could
easily produce circular dependencies when deployed.
This solution is somewhat clumsy to use today, but should become
reasonably ergonomic once
[link_extra_lib](https://bazel.build/reference/be/c-cpp#cc_binary.link_extra_lib)
and platform-based flags become available.
Bug: b/234877642
Change-Id: I5a53299675d45ea173a8888d879799e25fc26d54
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/177842
Reviewed-by: Armando Montanez <amontanez@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ted Pudlik <tpudlik@google.com>
Diffstat (limited to 'pw_build')
-rw-r--r-- | pw_build/pigweed.bzl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pw_build/pigweed.bzl b/pw_build/pigweed.bzl index dd8cc2f32..1e793905c 100644 --- a/pw_build/pigweed.bzl +++ b/pw_build/pigweed.bzl @@ -48,6 +48,7 @@ def pw_cc_binary(**kwargs): # way to handle the facades without introducing a circular dependency into # the build. kwargs["deps"] = kwargs["deps"] + ["@pigweed//targets:pw_assert_backend_impl"] + kwargs["deps"] = kwargs["deps"] + ["@pigweed//pw_log:backend_impl"] _add_defaults(kwargs) native.cc_binary(**kwargs) |