Skip to content

Commit

Permalink
cmake: fix package LIBKCAPI option
Browse files Browse the repository at this point in the history
  • Loading branch information
embetrix committed Feb 6, 2025
1 parent a99fd82 commit 53162e4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ endif()

option(USE_KERNEL_CRYPTO_API "Use the kernel crypto API to perform the hashing")
if(USE_KERNEL_CRYPTO_API)
list(APPEND CRYPTO_LIBRARIES kcapi)
add_compile_definitions(USE_KERNEL_CRYPTO_API)
pkg_check_modules(LIBKCAPI REQUIRED libkcapi)
if (LIBKCAPI_FOUND)
include_directories(${LIBKCAPI_INCLUDE_DIRS})
link_directories(${LIBKCAPI_LIBRARY_DIRS})
list(APPEND CRYPTO_LIBRARIES ${LIBKCAPI_LIBRARIES})
add_compile_definitions(USE_KERNEL_CRYPTO_API)
else()
message(FATAL_ERROR "libkcapi not found")
endif()
endif()

if (NOT DEFINED DEFAULT_READ_BLK_SIZE)
Expand Down

0 comments on commit 53162e4

Please sign in to comment.