Chris Brand | db22899 | 2022-05-31 15:05:09 -0700 | [diff] [blame^] | 1 | #------------------------------------------------------------------------------- |
| 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 | #------------------------------------------------------------------------------- |
| 9 | cmake_minimum_required(VERSION 3.15) |
| 10 | cmake_policy(SET CMP0076 NEW) |
| 11 | cmake_policy(SET CMP0079 NEW) |
| 12 | |
| 13 | if (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() |
| 16 | endif() |
| 17 | |
| 18 | add_library(platform_ns STATIC EXCLUDE_FROM_ALL) |
| 19 | |
| 20 | target_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> |
| 24 | ) |
| 25 | |
| 26 | target_link_libraries(platform_ns |
| 27 | PUBLIC |
| 28 | platform_common_interface |
| 29 | platform_region_defs |
| 30 | tfm_ns_interface |
| 31 | ) |
| 32 | |
| 33 | target_compile_definitions(platform_ns |
| 34 | PUBLIC |
| 35 | # CONFIG_TFM_FP |
| 36 | $<$<STREQUAL:${CONFIG_TFM_FP},hard>:CONFIG_TFM_FP=2> |
| 37 | $<$<STREQUAL:${CONFIG_TFM_FP},soft>:CONFIG_TFM_FP=0> |
| 38 | $<$<BOOL:${TEST_NS_FPU}>:TEST_NS_FPU> |
| 39 | $<$<BOOL:${CONFIG_TFM_ENABLE_FPU}>:CONFIG_TFM_ENABLE_FPU> |
| 40 | PRIVATE |
| 41 | $<$<BOOL:${TEST_NS_SLIH_IRQ}>:TEST_NS_SLIH_IRQ> |
| 42 | ) |
| 43 | |
| 44 | target_compile_options(platform_ns |
| 45 | PUBLIC |
| 46 | ${COMPILER_CP_FLAG} |
| 47 | ) |