Add libcvc dep

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2026-05-07 01:33:38 +02:00
parent 1be7acaedd
commit 5838d6f443
2 changed files with 16 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ set(MBEDTLS_PATH "${CMAKE_CURRENT_LIST_DIR}/../third-party/mbedtls")
set(TINYCBOR_PATH "${CMAKE_CURRENT_LIST_DIR}/../third-party/tinycbor")
set(CJSON_PATH "${CMAKE_CURRENT_LIST_DIR}/../third-party/cjson")
set(MLKEM_PATH "${CMAKE_CURRENT_LIST_DIR}/../third-party/mlkem")
set(LIBCVC_PATH "${CMAKE_CURRENT_LIST_DIR}/../third-party/libcvc")
set(PICOKEYS_MBEDTLS_STD_REPO "https://github.com/Mbed-TLS/mbedtls.git")
set(PICOKEYS_MBEDTLS_STD_REF "v3.6.6")
@@ -24,6 +25,8 @@ set(PICOKEYS_CJSON_REPO "https://github.com/DaveGamble/cJSON.git")
set(PICOKEYS_CJSON_REF "v1.7.19")
set(PICOKEYS_MLKEM_REPO "https://github.com/pq-code-package/mlkem-native.git")
set(PICOKEYS_MLKEM_REF "v1.1.0")
set(PICOKEYS_LIBCVC_REPO "https://github.com/polhenarejos/libcvc.git")
set(PICOKEYS_LIBCVC_REF "main")
set(PICOKEYS_FETCH_DEPS_ON_DEMAND ON CACHE BOOL "Fetch third-party deps into pico-keys-sdk/third-party when missing")
@@ -119,3 +122,6 @@ endif()
if(ENABLE_PQC)
picokeys_sync_dep(mlkem_dep "${PICOKEYS_MLKEM_REPO}" "${PICOKEYS_MLKEM_REF}" "${MLKEM_PATH}")
endif()
if(ENABLE_LIBCVC)
picokeys_sync_dep(libcvc_dep "${PICOKEYS_LIBCVC_REPO}" "${PICOKEYS_LIBCVC_REF}" "${LIBCVC_PATH}")
endif()

View File

@@ -356,6 +356,16 @@ if(NOT ESP_PLATFORM)
add_library(mbedtls STATIC ${MBEDTLS_SOURCES})
target_include_directories(mbedtls SYSTEM PUBLIC ${CMAKE_CURRENT_LIST_DIR}/third-party/mbedtls/include)
endif()
if(ENABLE_LIBCVC)
if(EXISTS "${LIBCVC_PATH}/CMakeLists.txt")
if(NOT TARGET cvc)
add_subdirectory(${LIBCVC_PATH} ${CMAKE_BINARY_DIR}/libcvc_build)
endif()
list(APPEND LIBRARIES cvc)
else()
message(FATAL_ERROR "ENABLE_LIBCVC is ON but libcvc source is missing at ${LIBCVC_PATH}")
endif()
endif()
if(USB_ITF_HID)
add_library(tinycbor STATIC ${CBOR_SOURCES})
target_include_directories(tinycbor SYSTEM PUBLIC ${CMAKE_CURRENT_LIST_DIR}/third-party/tinycbor/src)