Kevin Peng | d0e4971 | 2022-12-07 11:13:01 +0800 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2023, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | # Fetch tf-m-tests repo during config, if NS or regression test is required. |
| 9 | # Therefore tf-m-tests configs can be set with TF-M configs since their configs |
| 10 | # are coupled. |
| 11 | include(lib/ext/tf-m-tests/fetch_repo.cmake) |
| 12 | |
| 13 | # Load TF-M regression test suites setting |
Kevin Peng | b9c99f0 | 2022-12-07 11:23:17 +0800 | [diff] [blame] | 14 | if(NOT USE_KCONFIG_TOOL AND (TFM_NS_REG_TEST OR TFM_S_REG_TEST)) |
Kevin Peng | d0e4971 | 2022-12-07 11:13:01 +0800 | [diff] [blame] | 15 | include(${TFM_TEST_PATH}/config/set_config.cmake) |
| 16 | endif() |
| 17 | |
| 18 | # Build system log config |
| 19 | include(${CMAKE_SOURCE_DIR}/config/tfm_build_log_config.cmake) |
| 20 | |
| 21 | # The library to collect compile definitions of config options. |
| 22 | add_library(tfm_config INTERFACE) |
| 23 | |
| 24 | target_compile_definitions(tfm_config |
| 25 | INTERFACE |
Kevin Peng | f6721c7 | 2023-03-01 16:12:45 +0800 | [diff] [blame] | 26 | $<$<STREQUAL:${TEST_PSA_API},CRYPTO>:PSA_API_TEST_CRYPTO> |
| 27 | $<$<STREQUAL:${TEST_PSA_API},IPC>:PSA_API_TEST_IPC> |
Kevin Peng | d0e4971 | 2022-12-07 11:13:01 +0800 | [diff] [blame] | 28 | ) |
| 29 | |
| 30 | # Set user defined TF-M config header file |
| 31 | if(PROJECT_CONFIG_HEADER_FILE) |
| 32 | if(NOT EXISTS ${PROJECT_CONFIG_HEADER_FILE}) |
| 33 | message(FATAL_ERROR "${PROJECT_CONFIG_HEADER_FILE} does not exist! Please use absolute path.") |
| 34 | endif() |
| 35 | target_compile_definitions(tfm_config |
| 36 | INTERFACE |
| 37 | PROJECT_CONFIG_HEADER_FILE="${PROJECT_CONFIG_HEADER_FILE}" |
| 38 | ) |
| 39 | endif() |
| 40 | |
| 41 | # Set platform defined TF-M config header file |
| 42 | set(TARGET_CONFIG_HEADER_FILE ${TARGET_PLATFORM_PATH}/config_tfm_target.h) |
| 43 | if(EXISTS ${TARGET_CONFIG_HEADER_FILE}) |
| 44 | target_compile_definitions(tfm_config |
| 45 | INTERFACE |
| 46 | TARGET_CONFIG_HEADER_FILE="${TARGET_CONFIG_HEADER_FILE}" |
| 47 | ) |
| 48 | endif() |
David Hu | 6d1a9b6 | 2023-02-22 16:54:04 +0800 | [diff] [blame] | 49 | |
| 50 | target_include_directories(tfm_config |
| 51 | INTERFACE |
| 52 | ${CMAKE_CURRENT_LIST_DIR} |
| 53 | ) |