Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Kevin Peng | a9ec66f | 2022-07-05 15:21:16 +0800 | [diff] [blame] | 2 | # Copyright (c) 2020-2022, Arm Limited. All rights reserved. |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | if (NOT TFM_PARTITION_EXAMPLE) |
| 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_example STATIC) |
| 19 | |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 20 | target_sources(tfm_app_rot_partition_example |
| 21 | PRIVATE |
| 22 | tfm_example_partition.c |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 23 | ) |
Kevin Peng | a9ec66f | 2022-07-05 15:21:16 +0800 | [diff] [blame] | 24 | |
| 25 | # Add the source files generated by parse tools when building. |
| 26 | # The intermedia file defines the partition stack. |
| 27 | target_sources(tfm_app_rot_partition_example |
| 28 | PRIVATE |
| 29 | ${CMAKE_BINARY_DIR}/generated/example_partition/auto_generated/intermedia_tfm_example_partition.c |
| 30 | ) |
| 31 | |
| 32 | # The load info file includes the static data of the partition. |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 33 | target_sources(tfm_partitions |
| 34 | INTERFACE |
Kevin Peng | a9ec66f | 2022-07-05 15:21:16 +0800 | [diff] [blame] | 35 | ${CMAKE_BINARY_DIR}/generated/example_partition/auto_generated/load_info_tfm_example_partition.c |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 36 | ) |
| 37 | |
| 38 | target_include_directories(tfm_app_rot_partition_example |
| 39 | PRIVATE |
Kevin Peng | a9ec66f | 2022-07-05 15:21:16 +0800 | [diff] [blame] | 40 | ${CMAKE_CURRENT_SOURCE_DIR} |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 41 | PUBLIC |
Kevin Peng | a9ec66f | 2022-07-05 15:21:16 +0800 | [diff] [blame] | 42 | ${CMAKE_BINARY_DIR}/generated/example_partition |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 43 | ) |
| 44 | |
| 45 | target_link_libraries(tfm_app_rot_partition_example |
| 46 | PRIVATE |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 47 | psa_interface |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 48 | tfm_sprt |
| 49 | ) |
| 50 | |
| 51 | ############################ Secure API ######################################## |
| 52 | |
Kevin Peng | a9ec66f | 2022-07-05 15:21:16 +0800 | [diff] [blame] | 53 | target_sources(tfm_sprt |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 54 | INTERFACE |
Kevin Peng | a9ec66f | 2022-07-05 15:21:16 +0800 | [diff] [blame] | 55 | ${CMAKE_CURRENT_SOURCE_DIR}/tfm_example_partition_api.c |
| 56 | ) |
| 57 | |
| 58 | target_include_directories(tfm_sprt |
| 59 | PUBLIC |
| 60 | . |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 61 | ) |
| 62 | |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 63 | ############################ Partition Defs #################################### |
| 64 | |
| 65 | target_link_libraries(tfm_partitions |
| 66 | INTERFACE |
| 67 | tfm_app_rot_partition_example |
| 68 | ) |
| 69 | |
Xinyu Zhang | 9120413 | 2023-06-19 19:08:43 +0800 | [diff] [blame^] | 70 | target_compile_definitions(tfm_config |
Anton Komlev | 4bfd6c5 | 2022-06-29 17:10:26 +0100 | [diff] [blame] | 71 | INTERFACE |
| 72 | TFM_PARTITION_EXAMPLE |
| 73 | ) |