Make CryptoCell 310 part of mbed-mbedtls on supported targets

The CMake target mbed-mbedtls-cryptocell310 was not linked by
default, resulting in a compilation error on targets that use
Mbed TLS:

    fatal error: mbedtls_device.h: No such file or directory

Other Mbed TLS drivers simply add themselve to mbed-mbedtls, so this
commits does the alignment to fix the build error.

Note: the driver and the core Mbed TLS have mutual dependency, so
they need to be one CMake target.
pull/14435/head
Lingkai Dong 2021-03-16 17:04:00 +00:00
parent 9d48bfecb7
commit 4c6f8867d4
5 changed files with 8 additions and 14 deletions

View File

@ -13,7 +13,6 @@ add_library(mbed-emac INTERFACE)
add_library(mbed-lorawan INTERFACE)
add_library(mbed-lwipstack INTERFACE)
add_library(mbed-mbedtls INTERFACE)
add_library(mbed-mbedtls-cryptocell310 INTERFACE)
add_library(mbed-nanostack INTERFACE)
add_library(mbed-nanostack-coap_service INTERFACE)
add_library(mbed-nanostack-mbed_mesh_api INTERFACE)

View File

@ -23,5 +23,5 @@ target_sources(mbed-ble-cordio
target_link_libraries(mbed-ble-cordio
INTERFACE
mbed-ble-cordio_ll
mbed-mbedtls-cryptocell310
mbed-mbedtls
)

View File

@ -7,7 +7,7 @@ endif()
add_subdirectory(binaries)
target_include_directories(mbed-mbedtls-cryptocell310
target_include_directories(mbed-mbedtls
INTERFACE
.
./include
@ -15,7 +15,7 @@ target_include_directories(mbed-mbedtls-cryptocell310
./include/cryptocell310/internal
)
target_sources(mbed-mbedtls-cryptocell310
target_sources(mbed-mbedtls
INTERFACE
source/aes_alt.c
source/cc_internal.c
@ -29,12 +29,7 @@ target_sources(mbed-mbedtls-cryptocell310
source/trng.c
)
target_compile_definitions(mbed-mbedtls-cryptocell310
target_compile_definitions(mbed-mbedtls
INTERFACE
MBED_CONF_CRYPTOCELL310_PRESENT=1
)
target_link_libraries(mbed-mbedtls-cryptocell310
INTERFACE
mbed-mbedtls
)

View File

@ -9,17 +9,17 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(LIBCC_310_TRNG TOOLCHAIN_ARM/libcc_310_trng.ar)
endif()
target_include_directories(mbed-mbedtls-cryptocell310
target_include_directories(mbed-mbedtls
INTERFACE
.
)
target_sources(mbed-mbedtls-cryptocell310
target_sources(mbed-mbedtls
INTERFACE
crypto_device_platform.c
)
target_link_libraries(mbed-mbedtls-cryptocell310
target_link_libraries(mbed-mbedtls
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/${LIBCC_310_EXT}
${CMAKE_CURRENT_SOURCE_DIR}/${LIBCC_310_TRNG}

View File

@ -7,7 +7,7 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(LIBCC_310_CORE TOOLCHAIN_ARM/libcc_310_core.ar)
endif()
target_link_libraries(mbed-mbedtls-cryptocell310
target_link_libraries(mbed-mbedtls
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/${LIBCC_310_CORE}
)