idf_component_register(
    SRCS "virus.cpp" "se_ecdsa_alt.cpp"
    INCLUDE_DIRS "include"
    PRIV_REQUIRES proto driver esp_partition esp_system log json mqtt wifi esp_app_format esp_event esp_netif mbedtls config
    REQUIRES ble secure_enclave
)

# Force the linker to pull in se_ecdsa_alt.o — without this the object is
# dropped because its symbols are only referenced from the pre-built mbedtls
# archive or from components (e.g. registration) that don't link virus directly.
# se_ecdsa_enable_hw is always needed; mbedtls_ecdsa_sign only when ALT is active.
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,-u,se_ecdsa_enable_hw")
if(CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN)
    target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,-u,mbedtls_ecdsa_sign")
endif()


