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