blob: 6fffa7faeb9c639f764b0b4e0b650674e39abaa3 [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
32 tfm_ns_interface
33)
34
35target_compile_definitions(platform_ns
36 PUBLIC
37 # CONFIG_TFM_FP
38 $<$<STREQUAL:${CONFIG_TFM_FP},hard>:CONFIG_TFM_FP=2>
39 $<$<STREQUAL:${CONFIG_TFM_FP},soft>:CONFIG_TFM_FP=0>
40 $<$<BOOL:${TEST_NS_FPU}>:TEST_NS_FPU>
41 $<$<BOOL:${CONFIG_TFM_ENABLE_FPU}>:CONFIG_TFM_ENABLE_FPU>
42 PRIVATE
43 $<$<BOOL:${TEST_NS_SLIH_IRQ}>:TEST_NS_SLIH_IRQ>
44)
45
46target_compile_options(platform_ns
47 PUBLIC
48 ${COMPILER_CP_FLAG}
49)