blob: cd3b05c67b6574569b4c96ca39af8aa6d633daa4 [file] [log] [blame]
Raef Coles958aeef2020-10-08 12:12:58 +01001#-------------------------------------------------------------------------------
Kevin Peng38800662021-07-14 10:28:23 +08002# Copyright (c) 2020-2021, Arm Limited. All rights reserved.
Raef Coles958aeef2020-10-08 12:12:58 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8# The Configuration sequence is captured in the documentation, in
9# docs/getting_started/tfm_build_instructions.rst under Cmake Configuration. If
10# the sequence is updated here the docs must also be updated.
11
Tamas Ban69219202020-10-27 08:13:18 +000012# Load extra config
13if (TFM_EXTRA_CONFIG_PATH)
14 include(${TFM_EXTRA_CONFIG_PATH})
15endif()
Raef Coles958aeef2020-10-08 12:12:58 +010016
Tamas Ban69219202020-10-27 08:13:18 +000017# Load PSA config, setting options not already set
18if (TEST_PSA_API)
19 include(config/tests/config_test_psa_api.cmake)
20endif()
21
22# Load build type config, setting options not already set
Raef Coles958aeef2020-10-08 12:12:58 +010023string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWERCASE)
24if (EXISTS ${CMAKE_SOURCE_DIR}/config/build_type/${CMAKE_BUILD_TYPE_LOWERCASE}.cmake)
25 include(${CMAKE_SOURCE_DIR}/config/build_type/${CMAKE_BUILD_TYPE_LOWERCASE}.cmake)
26endif()
27
Tamas Ban69219202020-10-27 08:13:18 +000028# Load platform config, setting options not already set
Kevin Peng38800662021-07-14 10:28:23 +080029if (EXISTS ${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/config.cmake)
Tamas Ban69219202020-10-27 08:13:18 +000030 include(platform/ext/target/${TFM_PLATFORM}/config.cmake)
Raef Coles958aeef2020-10-08 12:12:58 +010031endif()
32
Tamas Ban69219202020-10-27 08:13:18 +000033# Load accelerator config, setting options not already set
34if (CRYPTO_HW_ACCELERATOR)
35 if (EXISTS ${CMAKE_SOURCE_DIR}/platform/ext/accelerator/${CRYPTO_HW_ACCELERATOR_TYPE}/config.cmake)
36 include(${CMAKE_SOURCE_DIR}/platform/ext/accelerator/${CRYPTO_HW_ACCELERATOR_TYPE}/config.cmake)
37 endif()
38endif()
39
40# Load profile config, setting options not already set
Raef Coles958aeef2020-10-08 12:12:58 +010041if (TFM_PROFILE)
Tamas Ban69219202020-10-27 08:13:18 +000042 include(config/profile/${TFM_PROFILE}.cmake)
Raef Coles958aeef2020-10-08 12:12:58 +010043endif()
44
David Hu9b6a1fe2020-12-21 15:16:09 +080045# Load TF-M model specific default config
46if (TFM_PSA_API)
47 include(config/tfm_ipc_config_default.cmake)
48endif()
49
Tamas Ban69219202020-10-27 08:13:18 +000050# Load defaults, setting options not already set
51include(config/config_default.cmake)
shejia01bfd37122021-06-03 13:31:51 +080052
53# Load TF-M test suites setting
54if (TEST_S OR
55 TEST_NS OR
56 TEST_NS_ATTESTATION OR
57 TEST_NS_T_COSE OR
58 TEST_NS_QCBOR OR
59 TEST_NS_AUDIT OR
60 TEST_NS_CORE OR
61 TEST_NS_CRYPTO OR
62 TEST_NS_ITS OR
63 TEST_NS_PS OR
64 TEST_NS_PLATFORM OR
65 TEST_NS_FWU OR
66 TEST_NS_IPC OR
67 TEST_NS_SLIH_IRQ OR
68 TEST_NS_FLIH_IRQ OR
69 TEST_NS_MULTI_CORE OR
70 TEST_S_ATTESTATION OR
71 TEST_S_AUDIT OR
72 TEST_S_CRYPTO OR
73 TEST_S_ITS OR
74 TEST_S_PS OR
75 TEST_S_PLATFORM OR
76 TEST_S_FWU OR
77 TEST_S_IPC)
78
79 # TFM_TEST is an internal cmake temporary value to manage tf-m-tests source
80 set(TFM_TEST ON)
shejia0150fc6842021-08-20 13:54:30 +080081 include(config/tests/set_config.cmake)
shejia01bfd37122021-06-03 13:31:51 +080082endif()