blob: aee3320235bfdcef6f11e148ec269ba1c4cd609a [file] [log] [blame]
Wyatt Hepler92ccb662020-01-21 18:28:41 -08001# Copyright 2020 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
Armando Montanezfb3d3fb2020-06-09 18:12:12 -070015# gn-format disable
16import("//build_overrides/pigweed.gni")
17
Alexei Frolovedd2f142020-06-09 19:11:27 -070018import("$dir_pw_build/target_types.gni")
Wyatt Hepler92ccb662020-01-21 18:28:41 -080019import("$dir_pw_docgen/docs.gni")
20import("$dir_pw_unit_test/test.gni")
Wyatt Hepler92ccb662020-01-21 18:28:41 -080021config("default_config") {
22 include_dirs = [ "public" ]
23}
24
Alexei Frolovedd2f142020-06-09 19:11:27 -070025pw_source_set("pw_checksum") {
Wyatt Hepler92ccb662020-01-21 18:28:41 -080026 public_configs = [ ":default_config" ]
Zihan Chen0a7db3e2020-06-23 16:36:06 -070027 public = [
28 "public/pw_checksum/ccitt_crc16.h",
29 "public/pw_checksum/crc32.h",
30 ]
31 sources = [
32 "ccitt_crc16.cc",
33 "crc32.cc",
34 ]
Rob Mohra0ba54f2020-02-27 11:43:49 -080035 public_deps = [ dir_pw_span ]
Wyatt Hepler92ccb662020-01-21 18:28:41 -080036}
37
38pw_test_group("tests") {
Zihan Chen0a7db3e2020-06-23 16:36:06 -070039 tests = [
40 ":ccitt_crc16_test",
41 ":crc32_test",
42 ]
Wyatt Hepler92ccb662020-01-21 18:28:41 -080043}
44
45pw_test("ccitt_crc16_test") {
Wyatt Heplereb8a34c2020-09-02 13:11:03 -070046 deps = [
47 ":pw_checksum",
48 dir_pw_bytes,
49 ]
Wyatt Hepler92ccb662020-01-21 18:28:41 -080050 sources = [
Wyatt Hepler92ccb662020-01-21 18:28:41 -080051 "ccitt_crc16_test.cc",
Michael Spanga99220e2020-06-11 20:07:16 -040052 "ccitt_crc16_test_c.c",
Wyatt Hepler92ccb662020-01-21 18:28:41 -080053 ]
54}
Wyatt Hepler3c4e5de2020-03-03 14:37:52 -080055
Zihan Chen0a7db3e2020-06-23 16:36:06 -070056pw_test("crc32_test") {
Wyatt Heplereb8a34c2020-09-02 13:11:03 -070057 deps = [
58 ":pw_checksum",
59 dir_pw_bytes,
60 ]
Zihan Chen0a7db3e2020-06-23 16:36:06 -070061 sources = [
62 "crc32_test.cc",
63 "crc32_test_c.c",
64 ]
65}
66
Wyatt Hepler3c4e5de2020-03-03 14:37:52 -080067pw_doc_group("docs") {
68 sources = [ "docs.rst" ]
69}