Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
David Hu | 04969a4 | 2020-06-14 21:25:35 +0800 | [diff] [blame^] | 2 | # Copyright (c) 2020-2021, Arm Limited. All rights reserved. |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
Raef Coles | 6981732 | 2020-10-19 14:14:14 +0100 | [diff] [blame] | 8 | cmake_minimum_required(VERSION 3.15) |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 9 | cmake_policy(SET CMP0076 NEW) |
| 10 | cmake_policy(SET CMP0079 NEW) |
| 11 | |
| 12 | |
| 13 | if (TFM_MULTI_CORE_TOPOLOGY) |
| 14 | include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload_ns.cmake) |
Raef Coles | e3bf94d | 2020-11-03 11:49:56 +0000 | [diff] [blame] | 15 | tfm_toolchain_reload_compiler() |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 16 | # The platform target is created in this directory/file so that it has the |
| 17 | # same settings as the main ns target. |
David Hu | 1d2329a | 2020-12-16 19:17:06 +0800 | [diff] [blame] | 18 | add_library(platform_ns STATIC EXCLUDE_FROM_ALL) |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 19 | endif() |
| 20 | |
| 21 | ###################### PSA interface (header only) ############################# |
| 22 | |
| 23 | add_library(psa_interface INTERFACE) |
| 24 | |
| 25 | target_include_directories(psa_interface |
| 26 | INTERFACE |
| 27 | ${CMAKE_CURRENT_SOURCE_DIR}/include |
| 28 | ${CMAKE_BINARY_DIR}/generated/interface/include |
| 29 | ${CMAKE_CURRENT_SOURCE_DIR}/include/os_wrapper |
David Hu | 04969a4 | 2020-06-14 21:25:35 +0800 | [diff] [blame^] | 30 | $<$<OR:$<BOOL:${FORWARD_PROT_MSG}>,$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>>:${CMAKE_CURRENT_SOURCE_DIR}/include/multi_core> |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 31 | ) |
| 32 | |
| 33 | # PSA interface files are generated from a template |
| 34 | add_dependencies(psa_interface |
| 35 | tfm_generated_files |
| 36 | ) |
| 37 | |
| 38 | target_link_libraries(psa_interface |
| 39 | INTERFACE |
| 40 | tfm_partition_defs |
| 41 | ) |
| 42 | |
| 43 | target_compile_definitions(psa_interface |
| 44 | INTERFACE |
| 45 | $<$<BOOL:${TFM_PSA_API}>:TFM_PSA_API> |
| 46 | $<$<BOOL:${TFM_NS_CLIENT_IDENTIFICATION}>:TFM_NS_CLIENT_IDENTIFICATION> |
| 47 | $<$<BOOL:${CONFIG_TFM_ENABLE_CTX_MGMT}>:CONFIG_TFM_ENABLE_CTX_MGMT> |
| 48 | $<$<BOOL:${TFM_ISOLATION_LEVEL}>:TFM_LVL=${TFM_ISOLATION_LEVEL}> |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 49 | $<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:TFM_MULTI_CORE_TOPOLOGY> |
David Hu | 6086394 | 2020-10-14 14:49:19 +0800 | [diff] [blame] | 50 | $<$<BOOL:${TFM_MULTI_CORE_MULTI_CLIENT_CALL}>:TFM_MULTI_CORE_MULTI_CLIENT_CALL> |
Mark Horvath | b9ac0d5 | 2020-09-09 10:48:22 +0200 | [diff] [blame] | 51 | $<$<BOOL:${FORWARD_PROT_MSG}>:FORWARD_PROT_MSG=${FORWARD_PROT_MSG}> |
Summer Qin | 2cd2ab7 | 2020-04-22 14:55:00 +0800 | [diff] [blame] | 52 | $<$<BOOL:${TFM_SP_META_PTR_ENABLE}>:TFM_SP_META_PTR_ENABLE> |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 53 | ) |
| 54 | |
| 55 | ###################### PSA api (S lib) ######################################### |
| 56 | |
| 57 | target_sources(tfm_secure_api |
| 58 | INTERFACE |
| 59 | $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/src/psa/psa_client.c> |
| 60 | $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/src/psa/psa_service.c> |
| 61 | $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/src/psa/psa_lifecycle.c> |
| 62 | ${CMAKE_CURRENT_SOURCE_DIR}/src/log/tfm_log_raw.c |
| 63 | ) |