blob: 43da0866ec9de7351110b178a925354609084123 [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") {
Rob Mohra0ba54f2020-02-27 11:43:49 -080046 deps = [ ":pw_checksum" ]
Wyatt Hepler92ccb662020-01-21 18:28:41 -080047 sources = [
Wyatt Hepler92ccb662020-01-21 18:28:41 -080048 "ccitt_crc16_test.cc",
Michael Spanga99220e2020-06-11 20:07:16 -040049 "ccitt_crc16_test_c.c",
Wyatt Hepler92ccb662020-01-21 18:28:41 -080050 ]
51}
Wyatt Hepler3c4e5de2020-03-03 14:37:52 -080052
Zihan Chen0a7db3e2020-06-23 16:36:06 -070053pw_test("crc32_test") {
54 deps = [ ":pw_checksum" ]
55 sources = [
56 "crc32_test.cc",
57 "crc32_test_c.c",
58 ]
59}
60
Wyatt Hepler3c4e5de2020-03-03 14:37:52 -080061pw_doc_group("docs") {
62 sources = [ "docs.rst" ]
63}