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 15include($ENV{PW_ROOT}/pw_build/pigweed.cmake) 16 17pw_add_library(pw_checksum STATIC 18 HEADERS 19 public/pw_checksum/crc16_ccitt.h 20 public/pw_checksum/crc32.h 21 PUBLIC_INCLUDES 22 public 23 PUBLIC_DEPS 24 pw_bytes 25 pw_checksum._config 26 pw_span 27 SOURCES 28 crc16_ccitt.cc 29 crc32.cc 30) 31 32# TODO: b/284002266 - Unresolved linker error when using pw_checksum above. 33# Created this crc32 library and linker error is resolved. 34pw_add_library(pw_checksum.crc32 STATIC 35 HEADERS 36 public/pw_checksum/crc32.h 37 PUBLIC_INCLUDES 38 public 39 PUBLIC_DEPS 40 pw_bytes 41 pw_checksum._config 42 pw_span 43 SOURCES 44 crc32.cc 45) 46 47pw_add_library(pw_checksum._config INTERFACE 48 HEADERS 49 public/pw_checksum/internal/config.h 50 PUBLIC_INCLUDES 51 public 52) 53 54pw_add_test(pw_checksum.crc16_ccitt_test 55 SOURCES 56 crc16_ccitt_test.cc 57 crc16_ccitt_test_c.c 58 PRIVATE_DEPS 59 pw_checksum 60 pw_random 61 GROUPS 62 modules 63 pw_checksum 64) 65 66pw_add_test(pw_checksum.crc32_test 67 SOURCES 68 crc32_test.cc 69 crc32_test_c.c 70 PRIVATE_DEPS 71 pw_checksum 72 pw_random 73 GROUPS 74 modules 75 pw_checksum 76) 77