blob: c237288d16ba784b8587831ed6533bcce7523181 [file] [log] [blame]
Chris Branddb228992022-05-31 15:05:09 -07001#-------------------------------------------------------------------------------
2# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
3# Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company)
4# or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
5#
6# SPDX-License-Identifier: BSD-3-Clause
7#
8#-------------------------------------------------------------------------------
9cmake_minimum_required(VERSION 3.15)
10cmake_policy(SET CMP0076 NEW)
11cmake_policy(SET CMP0079 NEW)
12
13if (EXISTS ${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload_ns.cmake)
14 include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload_ns.cmake)
15 tfm_toolchain_reload_compiler()
16endif()
17
18add_library(platform_ns STATIC EXCLUDE_FROM_ALL)
19
20target_sources(platform_ns
21 PRIVATE
22 $<$<BOOL:${PLATFORM_DEFAULT_UART_STDOUT}>:${CMAKE_CURRENT_SOURCE_DIR}/../ext/common/uart_stdout.c>
23 $<$<AND:$<NOT:$<BOOL:${SYMMETRIC_INITIAL_ATTESTATION}>>,$<BOOL:${TEST_NS_ATTESTATION}>>:${CMAKE_CURRENT_SOURCE_DIR}/../ext/common/template/tfm_initial_attest_pub_key.c>
shejia01f0ef2742022-06-06 14:24:14 +080024 PUBLIC
25 $<$<OR:$<BOOL:${TEST_S_FPU}>,$<BOOL:${TEST_NS_FPU}>>:${CMAKE_SOURCE_DIR}/platform/ext/common/test_interrupt.c>
Chris Branddb228992022-05-31 15:05:09 -070026)
27
28target_link_libraries(platform_ns
29 PUBLIC
30 platform_common_interface
31 platform_region_defs
Xinyu Zhang6ad07032022-08-10 14:45:56 +080032 tfm_fih_headers
Chris Branddb228992022-05-31 15:05:09 -070033 tfm_ns_interface
34)
35
36target_compile_definitions(platform_ns
37 PUBLIC
Gabor Toth4d414112021-11-10 17:44:50 +010038 $<$<STREQUAL:${CONFIG_TFM_FLOAT_ABI},hard>:CONFIG_TFM_FLOAT_ABI=2>
39 $<$<STREQUAL:${CONFIG_TFM_FLOAT_ABI},soft>:CONFIG_TFM_FLOAT_ABI=0>
Chris Branddb228992022-05-31 15:05:09 -070040 $<$<BOOL:${TEST_NS_FPU}>:TEST_NS_FPU>
Gabor Toth4d414112021-11-10 17:44:50 +010041 $<$<BOOL:${CONFIG_TFM_ENABLE_CP10CP11}>:CONFIG_TFM_ENABLE_CP10CP11>
Raef Coles79809c72022-03-02 13:48:20 +000042 $<$<BOOL:${PLATFORM_DEFAULT_CRYPTO_KEYS}>:PLATFORM_DEFAULT_CRYPTO_KEYS>
Chris Branddb228992022-05-31 15:05:09 -070043 PRIVATE
44 $<$<BOOL:${TEST_NS_SLIH_IRQ}>:TEST_NS_SLIH_IRQ>
45)
46
47target_compile_options(platform_ns
48 PUBLIC
49 ${COMPILER_CP_FLAG}
50)