hsdaoh/cmake/Modules/FindCRCFAST.cmake
Steve Markgraf a71d50969d lib: optionally use crc-fast-rust library
Typically, this CRC16 implementation is even faster, as it uses
32 bit SSE calculations and then trucates the output to 16 bits.
Also comes with AVX-512 support.

https://github.com/awesomized/crc-fast-rust
2026-01-24 23:43:58 +01:00

20 lines
493 B
CMake

find_path(CRCFAST_INCLUDE_DIR
NAMES libcrc_fast.h
)
find_library(CRCFAST_LIBRARY
NAMES crc_fast
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CRCFAST
REQUIRED_VARS CRCFAST_LIBRARY CRCFAST_INCLUDE_DIR
)
if(CRCFAST_FOUND)
add_library(CRCFAST::CRCFAST UNKNOWN IMPORTED)
set_target_properties(CRCFAST::CRCFAST PROPERTIES
IMPORTED_LOCATION "${CRCFAST_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${CRCFAST_INCLUDE_DIR}"
)
endif()