• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2024 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("@rules_cc//cc:cc_library.bzl", "cc_library")
16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library")
17load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
18load("//pw_build:pigweed.bzl", "pw_cc_test")
19
20package(default_visibility = ["//visibility:public"])
21
22licenses(["notice"])
23
24cc_library(
25    name = "checked_arithmetic",
26    hdrs = ["public/pw_numeric/checked_arithmetic.h"],
27    strip_include_prefix = "public",
28    deps = [
29        "//pw_preprocessor",
30    ],
31)
32
33pw_cc_test(
34    name = "checked_arithmetic_test",
35    srcs = ["checked_arithmetic_test.cc"],
36    deps = [":checked_arithmetic"],
37)
38
39cc_library(
40    name = "integer_division",
41    hdrs = ["public/pw_numeric/integer_division.h"],
42    strip_include_prefix = "public",
43)
44
45pw_cc_test(
46    name = "integer_division_test",
47    srcs = ["integer_division_test.cc"],
48    deps = [":integer_division"],
49)
50
51filegroup(
52    name = "doxygen",
53    srcs = [
54        "public/pw_numeric/checked_arithmetic.h",
55        "public/pw_numeric/integer_division.h",
56    ],
57)
58
59sphinx_docs_library(
60    name = "docs",
61    srcs = [
62        "docs.rst",
63    ],
64    prefix = "pw_numeric/",
65    target_compatible_with = incompatible_with_mcu(),
66)
67