| #------------------------------------------------------------------------------- |
| # Copyright (c) 2023, Arm Limited. All rights reserved. |
| # |
| # SPDX-License-Identifier: BSD-3-Clause |
| # |
| #------------------------------------------------------------------------------- |
| |
| if (NOT TFM_PARTITION_DPE) |
| return() |
| endif() |
| |
| cmake_minimum_required(VERSION 3.15) |
| cmake_policy(SET CMP0079 NEW) |
| |
| # The name of the target is required to be of the pattern |
| # tfm_app_rot_partition_x or tfm_psa_rot_partition_x, as it affects how the |
| # linker script will lay the partition in memory. |
| add_library(tfm_app_rot_partition_dpe STATIC) |
| |
| target_sources(tfm_app_rot_partition_dpe |
| PRIVATE |
| dpe_cmd_decode.c |
| dpe_impl.c |
| dpe_log.c |
| dpe_req_mngr.c |
| ) |
| |
| # Add the source files generated by parse tools when building. |
| # The intermedia file defines the partition stack. |
| target_sources(tfm_app_rot_partition_dpe |
| PRIVATE |
| ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment/auto_generated/intermedia_tfm_dpe.c |
| ) |
| |
| # The load info file includes the static data of the partition. |
| target_sources(tfm_partitions |
| INTERFACE |
| ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment/auto_generated/load_info_tfm_dpe.c |
| ) |
| |
| target_include_directories(tfm_app_rot_partition_dpe |
| PRIVATE |
| ${CMAKE_CURRENT_SOURCE_DIR} |
| PUBLIC |
| ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment |
| ) |
| |
| target_link_libraries(tfm_app_rot_partition_dpe |
| PRIVATE |
| tfm_sprt |
| qcbor |
| ) |
| |
| ############################ Secure API ######################################## |
| |
| target_sources(tfm_sprt |
| PRIVATE |
| ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c |
| ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c |
| ) |
| |
| target_include_directories(tfm_sprt |
| PUBLIC |
| ${CMAKE_CURRENT_SOURCE_DIR}/interface/include |
| ) |
| |
| target_link_libraries(tfm_sprt |
| PRIVATE |
| qcbor |
| ) |
| |
| ############################ Non-secure API #################################### |
| |
| add_library(dpe_api_ns INTERFACE) |
| |
| target_sources(dpe_api_ns |
| INTERFACE |
| ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c |
| ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c |
| ) |
| |
| target_include_directories(dpe_api_ns |
| INTERFACE |
| ${CMAKE_CURRENT_SOURCE_DIR}/interface/include |
| ) |
| |
| target_link_libraries(dpe_api_ns |
| INTERFACE |
| tfm_qcbor_ns |
| ) |
| |
| ############################ Partition Defs #################################### |
| |
| target_link_libraries(tfm_partitions |
| INTERFACE |
| tfm_app_rot_partition_dpe |
| ) |
| |
| target_compile_definitions(tfm_config |
| INTERFACE |
| TFM_PARTITION_DPE |
| ) |
| |
| install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c |
| ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c |
| DESTINATION ${TFM_INSTALL_PATH}/interface/src) |
| |
| install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/interface/include/dice_protection_environment.h |
| ${CMAKE_CURRENT_SOURCE_DIR}/interface/include/dpe_client.h |
| DESTINATION ${TFM_INSTALL_PATH}/interface/include) |