• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 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(
16    "//pw_build:pigweed.bzl",
17    "pw_cc_binary",
18)
19
20package(default_visibility = ["//visibility:public"])
21
22licenses(["notice"])
23
24# TODO(keir): Figure out why sharing deps doesn't work. Switching the hardcoded
25# deps to this shared variable breaks with a confusing error message;
26#
27#   ERROR: /Users/keir/wrk/pigweed/pw_checksum/size_report/BUILD.bazel:46:13:
28#     Label '//pw_assert:pw_assert' is duplicated in the 'deps'
29#     attribute of rule 'crc16_checksum'
30#   ERROR: package contains errors: pw_checksum/size_report
31#
32
33pw_cc_binary(
34    name = "noop_checksum",
35    srcs = ["run_checksum.cc"],
36    copts = ["-DUSE_NOOP_CHECKSUM=1"],
37    deps = [
38        "//pw_bloat:bloat_this_binary",
39        "//pw_checksum",
40        "//pw_log",
41        "//pw_preprocessor",
42        "//pw_span",
43    ],
44)
45
46pw_cc_binary(
47    name = "crc16_checksum",
48    srcs = ["run_checksum.cc"],
49    copts = ["-DUSE_CRC16_CHECKSUM=1"],
50    deps = [
51        "//pw_bloat:bloat_this_binary",
52        "//pw_checksum",
53        "//pw_log",
54        "//pw_preprocessor",
55        "//pw_span",
56    ],
57)
58
59pw_cc_binary(
60    name = "crc32_8bit_checksum",
61    srcs = ["run_checksum.cc"],
62    copts = ["-DUSE_CRC32_8BIT_CHECKSUM=1"],
63    deps = [
64        "//pw_bloat:bloat_this_binary",
65        "//pw_checksum",
66        "//pw_log",
67        "//pw_preprocessor",
68        "//pw_span",
69    ],
70)
71
72pw_cc_binary(
73    name = "crc32_4bit_checksum",
74    srcs = ["run_checksum.cc"],
75    copts = ["-DUSE_CRC32_4BIT_CHECKSUM=1"],
76    deps = [
77        "//pw_bloat:bloat_this_binary",
78        "//pw_checksum",
79        "//pw_log",
80        "//pw_preprocessor",
81        "//pw_span",
82    ],
83)
84
85pw_cc_binary(
86    name = "crc32_1bit_checksum",
87    srcs = ["run_checksum.cc"],
88    copts = ["-DUSE_CRC32_1BIT_CHECKSUM=1"],
89    deps = [
90        "//pw_bloat:bloat_this_binary",
91        "//pw_checksum",
92        "//pw_log",
93        "//pw_preprocessor",
94        "//pw_span",
95    ],
96)
97
98pw_cc_binary(
99    name = "fletcher16_checksum",
100    srcs = ["run_checksum.cc"],
101    copts = ["-DUSE_FLETCHER16_CHECKSUM=1"],
102    deps = [
103        "//pw_bloat:bloat_this_binary",
104        "//pw_checksum",
105        "//pw_log",
106        "//pw_preprocessor",
107        "//pw_span",
108    ],
109)
110