Boris Deletic | 08f4896 | 2020-10-28 12:42:58 +0000 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Raef Coles | b8c93e3 | 2021-06-03 10:10:45 +0100 | [diff] [blame] | 2 | # Copyright (c) 2020-2021, Arm Limited. All rights reserved. |
Boris Deletic | 08f4896 | 2020-10-28 12:42:58 +0000 | [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 | |
Raef Coles | b8c93e3 | 2021-06-03 10:10:45 +0100 | [diff] [blame] | 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) |
Boris Deletic | 08f4896 | 2020-10-28 12:42:58 +0000 | [diff] [blame] | 19 | |
Raef Coles | b8c93e3 | 2021-06-03 10:10:45 +0100 | [diff] [blame] | 20 | target_sources(tfm_app_rot_partition_example |
Boris Deletic | 08f4896 | 2020-10-28 12:42:58 +0000 | [diff] [blame] | 21 | PRIVATE |
| 22 | tfm_example_partition.c |
| 23 | ) |
| 24 | |
Raef Coles | b8c93e3 | 2021-06-03 10:10:45 +0100 | [diff] [blame] | 25 | target_include_directories(tfm_app_rot_partition_example |
Boris Deletic | 08f4896 | 2020-10-28 12:42:58 +0000 | [diff] [blame] | 26 | PRIVATE |
| 27 | $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> |
| 28 | ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/example_partition |
| 29 | ) |
| 30 | |
Raef Coles | b8c93e3 | 2021-06-03 10:10:45 +0100 | [diff] [blame] | 31 | target_link_libraries(tfm_app_rot_partition_example |
Boris Deletic | 08f4896 | 2020-10-28 12:42:58 +0000 | [diff] [blame] | 32 | PRIVATE |
| 33 | tfm_secure_api |
| 34 | psa_interface |
| 35 | platform_s |
Shawn Shan | 77ea231 | 2021-06-17 14:58:53 +0800 | [diff] [blame^] | 36 | tfm_sprt |
Boris Deletic | 08f4896 | 2020-10-28 12:42:58 +0000 | [diff] [blame] | 37 | ) |
| 38 | |
| 39 | ############################ Secure API ######################################## |
| 40 | |
| 41 | target_sources(tfm_secure_api |
Raef Coles | b8c93e3 | 2021-06-03 10:10:45 +0100 | [diff] [blame] | 42 | INTERFACE |
Boris Deletic | 08f4896 | 2020-10-28 12:42:58 +0000 | [diff] [blame] | 43 | ${CMAKE_CURRENT_SOURCE_DIR}/tfm_example_partition_secure_api.c |
| 44 | ) |
| 45 | |
| 46 | # The veneers give warnings about not being properly declared so they get hidden |
| 47 | # to not overshadow _real_ warnings. |
| 48 | set_source_files_properties(tfm_example_partition_secure_api.c |
| 49 | PROPERTIES |
| 50 | COMPILE_FLAGS -Wno-implicit-function-declaration |
| 51 | ) |
| 52 | |
| 53 | ############################ Partition Defs #################################### |
| 54 | |
| 55 | target_link_libraries(tfm_partitions |
| 56 | INTERFACE |
Raef Coles | b8c93e3 | 2021-06-03 10:10:45 +0100 | [diff] [blame] | 57 | tfm_app_rot_partition_example |
Boris Deletic | 08f4896 | 2020-10-28 12:42:58 +0000 | [diff] [blame] | 58 | ) |
| 59 | |
| 60 | target_compile_definitions(tfm_partition_defs |
| 61 | INTERFACE |
| 62 | TFM_PARTITION_EXAMPLE |
| 63 | ) |