pw_assert: Add basic Bazel support
Change-Id: Ic46c20bf80df111950ea0b2853f363cf0e00a9d2
diff --git a/pw_assert/BUILD b/pw_assert/BUILD
index c6af310..4dca3ec 100644
--- a/pw_assert/BUILD
+++ b/pw_assert/BUILD
@@ -12,22 +12,43 @@
# License for the specific language governing permissions and limitations under
# the License.
+load(
+ "//pw_build:pigweed.bzl",
+ "pw_cc_library",
+ "pw_cc_test",
+)
+
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
-filegroup(
- name = "pw_assert",
- srcs = [
+# TODO(pwbug/101): Need to add support for facades/backends to Bazel.
+PW_ASSERT_BACKEND = "//pw_assert_basic"
+
+pw_cc_library(
+ name = "facade",
+ hdrs = [
"public/pw_assert/assert.h",
],
+ includes = ["public"],
+ deps = [
+ "//pw_preprocessor",
+ ],
)
-# TODO: This isn't a real Bazel build yet.
-filegroup(
+pw_cc_library(
+ name = "pw_assert",
+ deps = [
+ ":facade",
+ PW_ASSERT_BACKEND,
+ ],
+)
+
+pw_cc_test(
name = "test",
srcs = [
"assert_test.cc",
"assert_test.c",
],
+ deps = [":pw_assert"],
)
diff --git a/pw_assert_basic/BUILD b/pw_assert_basic/BUILD
index 1292e17..6a04d08 100644
--- a/pw_assert_basic/BUILD
+++ b/pw_assert_basic/BUILD
@@ -12,15 +12,31 @@
# License for the specific language governing permissions and limitations under
# the License.
+load(
+ "//pw_build:pigweed.bzl",
+ "pw_cc_library",
+)
+
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
-filegroup(
+pw_cc_library(
name = "pw_assert_basic",
srcs = [
+ "assert_basic.cc",
+ ],
+ hdrs = [
"public/pw_assert_basic/assert_basic.h",
"public_overrides/pw_assert_backend/assert_backend.h",
- "assert_basic.cc",
+ ],
+ includes = [
+ "public",
+ "public_overrides",
+ ],
+ deps = [
+ "//pw_dumb_io",
+ "//pw_assert:facade",
+ "//pw_string",
],
)