Jamie Fox | ab30e71 | 2023-03-30 17:48:36 +0100 | [diff] [blame^] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2023, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | if (NOT TFM_PARTITION_DPE) |
| 9 | return() |
| 10 | endif() |
| 11 | |
| 12 | cmake_minimum_required(VERSION 3.15) |
| 13 | cmake_policy(SET CMP0079 NEW) |
| 14 | |
| 15 | # The name of the target is required to be of the pattern |
| 16 | # tfm_app_rot_partition_x or tfm_psa_rot_partition_x, as it affects how the |
| 17 | # linker script will lay the partition in memory. |
| 18 | add_library(tfm_app_rot_partition_dpe STATIC) |
| 19 | |
| 20 | target_sources(tfm_app_rot_partition_dpe |
| 21 | PRIVATE |
| 22 | dpe_cmd_decode.c |
| 23 | dpe_impl.c |
| 24 | dpe_req_mngr.c |
| 25 | ) |
| 26 | |
| 27 | # Add the source files generated by parse tools when building. |
| 28 | # The intermedia file defines the partition stack. |
| 29 | target_sources(tfm_app_rot_partition_dpe |
| 30 | PRIVATE |
| 31 | ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment/auto_generated/intermedia_tfm_dpe.c |
| 32 | ) |
| 33 | |
| 34 | # The load info file includes the static data of the partition. |
| 35 | target_sources(tfm_partitions |
| 36 | INTERFACE |
| 37 | ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment/auto_generated/load_info_tfm_dpe.c |
| 38 | ) |
| 39 | |
| 40 | target_include_directories(tfm_app_rot_partition_dpe |
| 41 | PRIVATE |
| 42 | ${CMAKE_CURRENT_SOURCE_DIR} |
| 43 | PUBLIC |
| 44 | ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment |
| 45 | ) |
| 46 | |
| 47 | target_link_libraries(tfm_app_rot_partition_dpe |
| 48 | PRIVATE |
| 49 | tfm_sprt |
| 50 | qcbor |
| 51 | ) |
| 52 | |
| 53 | ############################ Secure API ######################################## |
| 54 | |
| 55 | target_sources(tfm_sprt |
| 56 | PRIVATE |
| 57 | ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c |
| 58 | ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c |
| 59 | ) |
| 60 | |
| 61 | target_include_directories(tfm_sprt |
| 62 | PUBLIC |
| 63 | ${CMAKE_CURRENT_SOURCE_DIR}/interface/include |
| 64 | ) |
| 65 | |
| 66 | target_link_libraries(tfm_sprt |
| 67 | PRIVATE |
| 68 | qcbor |
| 69 | ) |
| 70 | |
| 71 | ############################ Non-secure API #################################### |
| 72 | |
| 73 | add_library(dpe_api_ns INTERFACE) |
| 74 | |
| 75 | target_sources(dpe_api_ns |
| 76 | INTERFACE |
| 77 | ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c |
| 78 | ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c |
| 79 | ) |
| 80 | |
| 81 | target_include_directories(dpe_api_ns |
| 82 | INTERFACE |
| 83 | ${CMAKE_CURRENT_SOURCE_DIR}/interface/include |
| 84 | ) |
| 85 | |
| 86 | target_link_libraries(dpe_api_ns |
| 87 | INTERFACE |
| 88 | tfm_qcbor_ns |
| 89 | ) |
| 90 | |
| 91 | ############################ Partition Defs #################################### |
| 92 | |
| 93 | target_link_libraries(tfm_partitions |
| 94 | INTERFACE |
| 95 | tfm_app_rot_partition_dpe |
| 96 | ) |
| 97 | |
| 98 | target_compile_definitions(tfm_config |
| 99 | INTERFACE |
| 100 | TFM_PARTITION_DPE |
| 101 | ) |
| 102 | |
| 103 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c |
| 104 | ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c |
| 105 | DESTINATION ${TFM_INSTALL_PATH}/interface/src) |
| 106 | |
| 107 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/interface/include/dice_protection_environment.h |
| 108 | ${CMAKE_CURRENT_SOURCE_DIR}/interface/include/dpe_client.h |
| 109 | DESTINATION ${TFM_INSTALL_PATH}/interface/include) |