xref: /aosp_15_r20/external/pigweed/pw_analog/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2021 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.
14
15load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
16load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
17
18package(default_visibility = ["//visibility:public"])
19
20licenses(["notice"])
21
22cc_library(
23    name = "analog_input",
24    hdrs = [
25        "public/pw_analog/analog_input.h",
26    ],
27    strip_include_prefix = "public",
28    deps = [
29        "//pw_chrono:system_clock",
30        "//pw_result",
31    ],
32)
33
34cc_library(
35    name = "microvolt_input",
36    hdrs = [
37        "public/pw_analog/microvolt_input.h",
38    ],
39    strip_include_prefix = "public",
40    deps = [
41        ":analog_input",
42        "//pw_chrono:system_clock",
43        "//pw_result",
44        "//pw_status",
45    ],
46)
47
48cc_library(
49    name = "microvolt_input_gmock",
50    testonly = True,
51    hdrs = [
52        "public/pw_analog/microvolt_input_gmock.h",
53    ],
54    strip_include_prefix = "public",
55    # TODO: b/310957361 - gtest not supported on device
56    target_compatible_with = incompatible_with_mcu(),
57    deps = [
58        ":microvolt_input",
59        "@com_google_googletest//:gtest",
60    ],
61)
62
63cc_library(
64    name = "analog_input_gmock",
65    testonly = True,
66    hdrs = [
67        "public/pw_analog/analog_input_gmock.h",
68    ],
69    strip_include_prefix = "public",
70    # TODO: b/310957361 - gtest not supported on device
71    target_compatible_with = incompatible_with_mcu(),
72    deps = [
73        ":analog_input",
74        "@com_google_googletest//:gtest",
75    ],
76)
77
78pw_cc_test(
79    name = "analog_input_test",
80    srcs = [
81        "analog_input_test.cc",
82    ],
83    deps = [
84        ":analog_input",
85        "//pw_unit_test",
86    ],
87)
88
89pw_cc_test(
90    name = "microvolt_input_test",
91    srcs = [
92        "microvolt_input_test.cc",
93    ],
94    deps = [
95        ":microvolt_input",
96        "//pw_unit_test",
97    ],
98)
99
100filegroup(
101    name = "doxygen",
102    srcs = [
103        "public/pw_analog/analog_input.h",
104        "public/pw_analog/microvolt_input.h",
105    ],
106)
107