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> |
shejia01 | f0ef274 | 2022-06-06 14:24:14 +0800 | [diff] [blame] | 24 | PUBLIC |
| 25 | $<$<OR:$<BOOL:${TEST_S_FPU}>,$<BOOL:${TEST_NS_FPU}>>:${CMAKE_SOURCE_DIR}/platform/ext/common/test_interrupt.c> |
Chris Brand | db22899 | 2022-05-31 15:05:09 -0700 | [diff] [blame] | 26 | ) |
| 27 | |
| 28 | target_link_libraries(platform_ns |
| 29 | PUBLIC |
| 30 | platform_common_interface |
| 31 | platform_region_defs |
Xinyu Zhang | 6ad0703 | 2022-08-10 14:45:56 +0800 | [diff] [blame^] | 32 | tfm_fih_headers |
Chris Brand | db22899 | 2022-05-31 15:05:09 -0700 | [diff] [blame] | 33 | tfm_ns_interface |
| 34 | ) |
| 35 | |
| 36 | target_compile_definitions(platform_ns |
| 37 | PUBLIC |
Gabor Toth | 4d41411 | 2021-11-10 17:44:50 +0100 | [diff] [blame] | 38 | $<$<STREQUAL:${CONFIG_TFM_FLOAT_ABI},hard>:CONFIG_TFM_FLOAT_ABI=2> |
| 39 | $<$<STREQUAL:${CONFIG_TFM_FLOAT_ABI},soft>:CONFIG_TFM_FLOAT_ABI=0> |
Chris Brand | db22899 | 2022-05-31 15:05:09 -0700 | [diff] [blame] | 40 | $<$<BOOL:${TEST_NS_FPU}>:TEST_NS_FPU> |
Gabor Toth | 4d41411 | 2021-11-10 17:44:50 +0100 | [diff] [blame] | 41 | $<$<BOOL:${CONFIG_TFM_ENABLE_CP10CP11}>:CONFIG_TFM_ENABLE_CP10CP11> |
Raef Coles | 79809c7 | 2022-03-02 13:48:20 +0000 | [diff] [blame] | 42 | $<$<BOOL:${PLATFORM_DEFAULT_CRYPTO_KEYS}>:PLATFORM_DEFAULT_CRYPTO_KEYS> |
Chris Brand | db22899 | 2022-05-31 15:05:09 -0700 | [diff] [blame] | 43 | PRIVATE |
| 44 | $<$<BOOL:${TEST_NS_SLIH_IRQ}>:TEST_NS_SLIH_IRQ> |
| 45 | ) |
| 46 | |
| 47 | target_compile_options(platform_ns |
| 48 | PUBLIC |
| 49 | ${COMPILER_CP_FLAG} |
| 50 | ) |