2023-09-28 16:52:52 +00:00
|
|
|
set(p256m_target ${MBEDTLS_TARGET_PREFIX}p256m)
|
|
|
|
|
|
|
|
add_library(${p256m_target}
|
2023-04-18 16:00:17 +00:00
|
|
|
p256-m_driver_entrypoints.c
|
|
|
|
p256-m/p256-m.c)
|
|
|
|
|
2023-09-28 16:52:52 +00:00
|
|
|
target_include_directories(${p256m_target}
|
2023-04-18 16:00:17 +00:00
|
|
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/p256-m>
|
|
|
|
$<BUILD_INTERFACE:${MBEDTLS_DIR}/include>
|
2024-06-10 07:41:49 +00:00
|
|
|
$<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/include>
|
2024-06-14 06:43:28 +00:00
|
|
|
$<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/drivers/builtin/include>
|
2023-04-18 16:00:17 +00:00
|
|
|
$<INSTALL_INTERFACE:include>
|
|
|
|
PRIVATE ${MBEDTLS_DIR}/library/)
|
|
|
|
|
2023-10-02 09:46:59 +00:00
|
|
|
# Pass-through MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE
|
|
|
|
# This must be duplicated from library/CMakeLists.txt because
|
|
|
|
# p256m is not directly linked against any mbedtls targets
|
|
|
|
# so does not inherit the compile definitions.
|
|
|
|
if(MBEDTLS_CONFIG_FILE)
|
2023-10-06 10:48:44 +00:00
|
|
|
target_compile_definitions(${p256m_target}
|
2023-10-02 09:46:59 +00:00
|
|
|
PUBLIC MBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}")
|
|
|
|
endif()
|
|
|
|
if(MBEDTLS_USER_CONFIG_FILE)
|
2023-10-06 10:48:44 +00:00
|
|
|
target_compile_definitions(${p256m_target}
|
2023-10-02 09:46:59 +00:00
|
|
|
PUBLIC MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}")
|
|
|
|
endif()
|
|
|
|
|
2023-04-18 16:00:17 +00:00
|
|
|
if(INSTALL_MBEDTLS_HEADERS)
|
|
|
|
|
|
|
|
install(DIRECTORY :${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
DESTINATION include
|
|
|
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
|
|
|
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
|
|
FILES_MATCHING PATTERN "*.h")
|
|
|
|
|
|
|
|
endif(INSTALL_MBEDTLS_HEADERS)
|
|
|
|
|
2023-09-28 16:52:52 +00:00
|
|
|
install(TARGETS ${p256m_target}
|
2023-04-18 16:00:17 +00:00
|
|
|
EXPORT MbedTLSTargets
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
2023-04-19 02:31:10 +00:00
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
|