xref: /aosp_15_r20/external/pigweed/pw_stream/rust/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2023 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14load("@rules_rust//rust:defs.bzl", "rust_doc", "rust_doc_test", "rust_library", "rust_test")
15load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
16
17rust_library(
18    name = "pw_stream",
19    srcs = [
20        "pw_stream/cursor.rs",
21        "pw_stream/integer.rs",
22        "pw_stream/lib.rs",
23    ],
24    crate_features = select({
25        "@rust_crates//:no_std": ["no_std"],
26        "//conditions:default": [""],
27    }),
28    proc_macro_deps = ["@rust_crates//:paste"],
29    visibility = ["//visibility:public"],
30    deps = [
31        "//pw_status/rust:pw_status",
32        "//pw_varint/rust:pw_varint",
33    ],
34)
35
36rust_test(
37    name = "pw_stream_test",
38    crate = ":pw_stream",
39    crate_features = select({
40        "@rust_crates//:no_std": ["no_std"],
41        "//conditions:default": [""],
42    }),
43    # TODO: b/343726867 - support on-device rust tests
44    target_compatible_with = incompatible_with_mcu(),
45)
46
47rust_doc_test(
48    name = "pw_stream_doc_test",
49    crate = ":pw_stream",
50    target_compatible_with = incompatible_with_mcu(),
51)
52
53rust_doc(
54    name = "pw_stream_doc",
55    crate = ":pw_stream",
56    target_compatible_with = incompatible_with_mcu(),
57)
58