blob: d1209afefcd070139e164f68fc16da39561d298d [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 -070015import("//build_overrides/pigweed.gni")
16
Alexei Frolovedd2f142020-06-09 19:11:27 -070017import("$dir_pw_build/target_types.gni")
Wyatt Hepler92ccb662020-01-21 18:28:41 -080018import("$dir_pw_docgen/docs.gni")
19import("$dir_pw_unit_test/test.gni")
Wyatt Heplerd49f8fe2020-10-15 10:13:47 -070020
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 = [
Wyatt Hepler12f66a12020-09-02 15:43:02 -070028 "public/pw_checksum/crc16_ccitt.h",
Zihan Chen0a7db3e2020-06-23 16:36:06 -070029 "public/pw_checksum/crc32.h",
30 ]
31 sources = [
Wyatt Hepler12f66a12020-09-02 15:43:02 -070032 "crc16_ccitt.cc",
Zihan Chen0a7db3e2020-06-23 16:36:06 -070033 "crc32.cc",
34 ]
Wyatt Hepler7abd8cc2021-01-19 16:49:33 -080035 public_deps = [ dir_pw_bytes ]
Wyatt Hepler92ccb662020-01-21 18:28:41 -080036}
37
38pw_test_group("tests") {
Zihan Chen0a7db3e2020-06-23 16:36:06 -070039 tests = [
Wyatt Hepler12f66a12020-09-02 15:43:02 -070040 ":crc16_ccitt_test",
Zihan Chen0a7db3e2020-06-23 16:36:06 -070041 ":crc32_test",
42 ]
Wyatt Hepler92ccb662020-01-21 18:28:41 -080043}
44
Wyatt Hepler12f66a12020-09-02 15:43:02 -070045pw_test("crc16_ccitt_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 Hepler12f66a12020-09-02 15:43:02 -070051 "crc16_ccitt_test.cc",
52 "crc16_ccitt_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}