| #------------------------------------------------------------------------------- |
| # Copyright (c) 2020-2022, Arm Limited. All rights reserved. |
| # |
| # SPDX-License-Identifier: BSD-3-Clause |
| # |
| #------------------------------------------------------------------------------- |
| |
| if (NOT TFM_PARTITION_EXAMPLE) |
| 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_example STATIC) |
| |
| target_sources(tfm_app_rot_partition_example |
| PRIVATE |
| tfm_example_partition.c |
| ) |
| |
| # Add the source files generated by parse tools when building. |
| # The intermedia file defines the partition stack. |
| target_sources(tfm_app_rot_partition_example |
| PRIVATE |
| ${CMAKE_BINARY_DIR}/generated/example_partition/auto_generated/intermedia_tfm_example_partition.c |
| ) |
| |
| # The load info file includes the static data of the partition. |
| target_sources(tfm_partitions |
| INTERFACE |
| ${CMAKE_BINARY_DIR}/generated/example_partition/auto_generated/load_info_tfm_example_partition.c |
| ) |
| |
| # Add dependency to the manifest_tool |
| add_dependencies(tfm_app_rot_partition_example manifest_tool) |
| |
| target_include_directories(tfm_app_rot_partition_example |
| PRIVATE |
| ${CMAKE_CURRENT_SOURCE_DIR} |
| PUBLIC |
| ${CMAKE_BINARY_DIR}/generated/example_partition |
| ) |
| |
| target_link_libraries(tfm_app_rot_partition_example |
| PRIVATE |
| tfm_sprt |
| ) |
| |
| ############################ Secure API ######################################## |
| |
| target_sources(tfm_sprt |
| INTERFACE |
| ${CMAKE_CURRENT_SOURCE_DIR}/tfm_example_partition_api.c |
| ) |
| |
| target_include_directories(tfm_sprt |
| PUBLIC |
| . |
| ) |
| |
| ############################ Partition Defs #################################### |
| |
| target_link_libraries(tfm_partitions |
| INTERFACE |
| tfm_app_rot_partition_example |
| ) |
| |
| target_compile_definitions(tfm_config |
| INTERFACE |
| TFM_PARTITION_EXAMPLE |
| ) |