blob: f68396d4ad61f0614c17716496492fcc0022150e [file] [log] [blame]
Raef Coles7d3545b2020-07-10 10:00:35 +01001#-------------------------------------------------------------------------------
2# Copyright (c) 2020, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
Raef Coles69817322020-10-19 14:14:14 +01008cmake_minimum_required(VERSION 3.15)
Raef Coles7d3545b2020-07-10 10:00:35 +01009cmake_policy(SET CMP0076 NEW)
10cmake_policy(SET CMP0079 NEW)
11
12
13if (TFM_MULTI_CORE_TOPOLOGY)
14 include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload_ns.cmake)
Raef Colese3bf94d2020-11-03 11:49:56 +000015 tfm_toolchain_reload_compiler()
Raef Coles7d3545b2020-07-10 10:00:35 +010016 # The platform target is created in this directory/file so that it has the
17 # same settings as the main ns target.
David Hu1d2329a2020-12-16 19:17:06 +080018 add_library(platform_ns STATIC EXCLUDE_FROM_ALL)
Raef Coles7d3545b2020-07-10 10:00:35 +010019endif()
20
21###################### PSA interface (header only) #############################
22
23add_library(psa_interface INTERFACE)
24
25target_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
30)
31
32# PSA interface files are generated from a template
33add_dependencies(psa_interface
34 tfm_generated_files
35)
36
37target_link_libraries(psa_interface
38 INTERFACE
39 tfm_partition_defs
40)
41
42target_compile_definitions(psa_interface
43 INTERFACE
44 $<$<BOOL:${TFM_PSA_API}>:TFM_PSA_API>
45 $<$<BOOL:${TFM_NS_CLIENT_IDENTIFICATION}>:TFM_NS_CLIENT_IDENTIFICATION>
46 $<$<BOOL:${CONFIG_TFM_ENABLE_CTX_MGMT}>:CONFIG_TFM_ENABLE_CTX_MGMT>
47 $<$<BOOL:${TFM_ISOLATION_LEVEL}>:TFM_LVL=${TFM_ISOLATION_LEVEL}>
Raef Coles7d3545b2020-07-10 10:00:35 +010048 $<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:TFM_MULTI_CORE_TOPOLOGY>
David Hu60863942020-10-14 14:49:19 +080049 $<$<BOOL:${TFM_MULTI_CORE_MULTI_CLIENT_CALL}>:TFM_MULTI_CORE_MULTI_CLIENT_CALL>
Mark Horvathb9ac0d52020-09-09 10:48:22 +020050 $<$<BOOL:${FORWARD_PROT_MSG}>:FORWARD_PROT_MSG=${FORWARD_PROT_MSG}>
Raef Coles7d3545b2020-07-10 10:00:35 +010051)
52
53###################### PSA api (S lib) #########################################
54
55target_sources(tfm_secure_api
56 INTERFACE
57 $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/src/psa/psa_client.c>
58 $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/src/psa/psa_service.c>
59 $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/src/psa/psa_lifecycle.c>
60 ${CMAKE_CURRENT_SOURCE_DIR}/src/log/tfm_log_raw.c
61)