aboutsummaryrefslogtreecommitdiff
path: root/pw_tokenizer
diff options
context:
space:
mode:
authorNathaniel Brough <nathaniel.brough@gmail.com>2021-04-18 22:52:00 +0800
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2021-05-01 16:57:23 +0000
commitc2d5781a76268bfdc00b2f5232bf3e7c1129bf37 (patch)
treec74a60863c6a407d5871677d0468eac330d22abe /pw_tokenizer
parent3d0e3152db29c24a75464b069557aab72a389595 (diff)
downloadpigweed-c2d5781a76268bfdc00b2f5232bf3e7c1129bf37.tar.gz
workspace: Switches Bazel builds to using facades
Switches over all packages that were previously working with Bazel to use the new facades API. In the process of doing this a few new modules where newly compatible with Bazel. This is reflected in the changes to the presubmit. Change-Id: I12aa67fa43b9ac2b947f33814f901dd00f929543 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/41561 Reviewed-by: Keir Mierle <keir@google.com> Reviewed-by: Akira Baruah <akirabaruah@google.com> Reviewed-by: Ewout van Bekkum <ewout@google.com> Commit-Queue: Keir Mierle <keir@google.com>
Diffstat (limited to 'pw_tokenizer')
-rw-r--r--pw_tokenizer/BUILD26
1 files changed, 15 insertions, 11 deletions
diff --git a/pw_tokenizer/BUILD b/pw_tokenizer/BUILD
index 4b288be09..49d2eea99 100644
--- a/pw_tokenizer/BUILD
+++ b/pw_tokenizer/BUILD
@@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations under
# the License.
+load("@rules_cc//cc:defs.bzl", "cc_binary")
load(
"//pw_build:pigweed.bzl",
"pw_cc_binary",
@@ -53,14 +54,9 @@ pw_cc_library(
],
)
-# TODO(pwbug/101): Need to add support for facades/backends to Bazel.
-PW_TOKENIZER_GLOBAL_HANDLER_BACKEND = "//pw_tokenizer:test_backend"
-
-PW_TOKENIZER_GLOBAL_HANDLER_WITH_PAYLOAD_BACKEND = "//pw_tokenizer:test_backend"
-
pw_cc_library(
name = "test_backend",
- visibility = ["//visibility:private"],
+ visibility = ["@pigweed_config//:__pkg__"],
)
pw_cc_library(
@@ -69,7 +65,7 @@ pw_cc_library(
hdrs = ["public/pw_tokenizer/tokenize_to_global_handler.h"],
deps = [
":pw_tokenizer",
- PW_TOKENIZER_GLOBAL_HANDLER_BACKEND,
+ "@pigweed_config//:pw_tokenizer_global_handler_backend",
],
)
@@ -79,7 +75,7 @@ pw_cc_library(
hdrs = ["public/pw_tokenizer/tokenize_to_global_handler_with_payload.h"],
deps = [
":pw_tokenizer",
- PW_TOKENIZER_GLOBAL_HANDLER_WITH_PAYLOAD_BACKEND,
+ "@pigweed_config//:pw_tokenizer_global_handler_with_payload_backend",
],
)
@@ -93,6 +89,7 @@ pw_cc_library(
],
includes = ["public"],
deps = [
+ ":pw_tokenizer",
"//pw_base64",
"//pw_preprocessor",
"//pw_span",
@@ -124,8 +121,15 @@ pw_cc_binary(
name = "generate_decoding_test_data",
srcs = [
"generate_decoding_test_data.cc",
- "tokenize_test_fakes.cc",
],
+ target_compatible_with = select(
+ {
+ "@platforms//os:linux": [],
+ "@platforms//os:windows": [],
+ "@platforms//os:macos": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ },
+ ),
deps = [
":decoder",
":pw_tokenizer",
@@ -155,7 +159,6 @@ pw_cc_test(
"argument_types_test.cc",
"argument_types_test_c.c",
"pw_tokenizer_private/argument_types_test.h",
- "tokenize_test_fakes.cc",
],
deps = [
":pw_tokenizer",
@@ -219,7 +222,6 @@ pw_cc_test(
srcs = [
"hash_test.cc",
"pw_tokenizer_private/generated_hash_test_cases.h",
- "tokenize_test_fakes.cc",
],
deps = [
":pw_tokenizer",
@@ -234,6 +236,8 @@ pw_cc_test(
"simple_tokenize_test.cc",
],
deps = [
+ ":global_handler",
+ ":global_handler_with_payload",
":pw_tokenizer",
"//pw_unit_test",
],