pw_unit_test: Add compatibility in bazel
Mark the targets that depend on googletest as only compatible with the
`:gtest_setting`
Bug: 309665550
Change-Id: I13fbba4258686fa0b51ac7e5935bfa49a19b16ee
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/184911
Pigweed-Auto-Submit: Carlos Chinchilla <cachinchilla@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Erik Gilling <konkers@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
diff --git a/pw_unit_test/BUILD.bazel b/pw_unit_test/BUILD.bazel
index 4ae12c2..86a8c61 100644
--- a/pw_unit_test/BUILD.bazel
+++ b/pw_unit_test/BUILD.bazel
@@ -122,6 +122,10 @@
srcs = ["googletest_handler_adapter.cc"],
hdrs = ["public/pw_unit_test/googletest_handler_adapter.h"],
includes = ["public"],
+ target_compatible_with = select({
+ ":gtest_setting": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
deps = [
":event_handler",
"//pw_preprocessor",
@@ -134,6 +138,10 @@
testonly = True,
hdrs = ["public/pw_unit_test/googletest_test_matchers.h"],
includes = ["public"],
+ target_compatible_with = select({
+ ":gtest_setting": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
deps = [
"//pw_result",
"//pw_status",
@@ -144,6 +152,10 @@
pw_cc_test(
name = "googletest_test_matchers_test",
srcs = ["googletest_test_matchers_test.cc"],
+ target_compatible_with = select({
+ ":gtest_setting": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
deps = [
":googletest_test_matchers",
],