blob: ca2c7d8f67f6a978074041303caa9fd57a314fbb [file] [log] [blame]
Kevin Pengd0e49712022-12-07 11:13:01 +08001#-------------------------------------------------------------------------------
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.
11include(lib/ext/tf-m-tests/fetch_repo.cmake)
12
13# Load TF-M regression test suites setting
Kevin Pengb9c99f02022-12-07 11:23:17 +080014if(NOT USE_KCONFIG_TOOL AND (TFM_NS_REG_TEST OR TFM_S_REG_TEST))
Kevin Pengd0e49712022-12-07 11:13:01 +080015 include(${TFM_TEST_PATH}/config/set_config.cmake)
16endif()
17
18# Build system log config
19include(${CMAKE_SOURCE_DIR}/config/tfm_build_log_config.cmake)
20
21# The library to collect compile definitions of config options.
22add_library(tfm_config INTERFACE)
23
24target_compile_definitions(tfm_config
25 INTERFACE
26 $<$<STREQUAL:${TEST_PSA_API},CRYPTO>:TEST_PSA_API_CRYPTO>
27 $<$<STREQUAL:${TEST_PSA_API},IPC>:TEST_PSA_API_IPC>
28)
29
30# Set user defined TF-M config header file
31if(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 )
39endif()
40
41# Set platform defined TF-M config header file
42set(TARGET_CONFIG_HEADER_FILE ${TARGET_PLATFORM_PATH}/config_tfm_target.h)
43if(EXISTS ${TARGET_CONFIG_HEADER_FILE})
44 target_compile_definitions(tfm_config
45 INTERFACE
46 TARGET_CONFIG_HEADER_FILE="${TARGET_CONFIG_HEADER_FILE}"
47 )
48endif()