Wyatt Hepler | 92ccb66 | 2020-01-21 18:28:41 -0800 | [diff] [blame] | 1 | # 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 Montanez | fb3d3fb | 2020-06-09 18:12:12 -0700 | [diff] [blame] | 15 | import("//build_overrides/pigweed.gni") |
| 16 | |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 17 | import("$dir_pw_build/target_types.gni") |
Wyatt Hepler | 92ccb66 | 2020-01-21 18:28:41 -0800 | [diff] [blame] | 18 | import("$dir_pw_docgen/docs.gni") |
| 19 | import("$dir_pw_unit_test/test.gni") |
Wyatt Hepler | d49f8fe | 2020-10-15 10:13:47 -0700 | [diff] [blame] | 20 | |
Wyatt Hepler | 92ccb66 | 2020-01-21 18:28:41 -0800 | [diff] [blame] | 21 | config("default_config") { |
| 22 | include_dirs = [ "public" ] |
| 23 | } |
| 24 | |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 25 | pw_source_set("pw_checksum") { |
Wyatt Hepler | 92ccb66 | 2020-01-21 18:28:41 -0800 | [diff] [blame] | 26 | public_configs = [ ":default_config" ] |
Zihan Chen | 0a7db3e | 2020-06-23 16:36:06 -0700 | [diff] [blame] | 27 | public = [ |
Wyatt Hepler | 12f66a1 | 2020-09-02 15:43:02 -0700 | [diff] [blame] | 28 | "public/pw_checksum/crc16_ccitt.h", |
Zihan Chen | 0a7db3e | 2020-06-23 16:36:06 -0700 | [diff] [blame] | 29 | "public/pw_checksum/crc32.h", |
| 30 | ] |
| 31 | sources = [ |
Wyatt Hepler | 12f66a1 | 2020-09-02 15:43:02 -0700 | [diff] [blame] | 32 | "crc16_ccitt.cc", |
Zihan Chen | 0a7db3e | 2020-06-23 16:36:06 -0700 | [diff] [blame] | 33 | "crc32.cc", |
| 34 | ] |
Wyatt Hepler | 7abd8cc | 2021-01-19 16:49:33 -0800 | [diff] [blame^] | 35 | public_deps = [ dir_pw_bytes ] |
Wyatt Hepler | 92ccb66 | 2020-01-21 18:28:41 -0800 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | pw_test_group("tests") { |
Zihan Chen | 0a7db3e | 2020-06-23 16:36:06 -0700 | [diff] [blame] | 39 | tests = [ |
Wyatt Hepler | 12f66a1 | 2020-09-02 15:43:02 -0700 | [diff] [blame] | 40 | ":crc16_ccitt_test", |
Zihan Chen | 0a7db3e | 2020-06-23 16:36:06 -0700 | [diff] [blame] | 41 | ":crc32_test", |
| 42 | ] |
Wyatt Hepler | 92ccb66 | 2020-01-21 18:28:41 -0800 | [diff] [blame] | 43 | } |
| 44 | |
Wyatt Hepler | 12f66a1 | 2020-09-02 15:43:02 -0700 | [diff] [blame] | 45 | pw_test("crc16_ccitt_test") { |
Wyatt Hepler | eb8a34c | 2020-09-02 13:11:03 -0700 | [diff] [blame] | 46 | deps = [ |
| 47 | ":pw_checksum", |
| 48 | dir_pw_bytes, |
| 49 | ] |
Wyatt Hepler | 92ccb66 | 2020-01-21 18:28:41 -0800 | [diff] [blame] | 50 | sources = [ |
Wyatt Hepler | 12f66a1 | 2020-09-02 15:43:02 -0700 | [diff] [blame] | 51 | "crc16_ccitt_test.cc", |
| 52 | "crc16_ccitt_test_c.c", |
Wyatt Hepler | 92ccb66 | 2020-01-21 18:28:41 -0800 | [diff] [blame] | 53 | ] |
| 54 | } |
Wyatt Hepler | 3c4e5de | 2020-03-03 14:37:52 -0800 | [diff] [blame] | 55 | |
Zihan Chen | 0a7db3e | 2020-06-23 16:36:06 -0700 | [diff] [blame] | 56 | pw_test("crc32_test") { |
Wyatt Hepler | eb8a34c | 2020-09-02 13:11:03 -0700 | [diff] [blame] | 57 | deps = [ |
| 58 | ":pw_checksum", |
| 59 | dir_pw_bytes, |
| 60 | ] |
Zihan Chen | 0a7db3e | 2020-06-23 16:36:06 -0700 | [diff] [blame] | 61 | sources = [ |
| 62 | "crc32_test.cc", |
| 63 | "crc32_test_c.c", |
| 64 | ] |
| 65 | } |
| 66 | |
Wyatt Hepler | 3c4e5de | 2020-03-03 14:37:52 -0800 | [diff] [blame] | 67 | pw_doc_group("docs") { |
| 68 | sources = [ "docs.rst" ] |
| 69 | } |