blob: 59d1ca09b2f9ec2988fe7747d9157c9f2992319d [file] [log] [blame]
Gyorgy Szing30fa9872017-12-05 01:08:47 +00001#-------------------------------------------------------------------------------
Kevin Pengd0e49712022-12-07 11:13:01 +08002# Copyright (c) 2020-2023, Arm Limited. All rights reserved.
Chris Brand9edf0812022-07-05 14:18:42 -07003# Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company)
4# or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
Gyorgy Szing30fa9872017-12-05 01:08:47 +00005#
6# SPDX-License-Identifier: BSD-3-Clause
7#
8#-------------------------------------------------------------------------------
9
David Hu1249f0d2023-12-04 22:57:56 +080010cmake_minimum_required(VERSION 3.21)
Gyorgy Szing30fa9872017-12-05 01:08:47 +000011
Chris Brand19bf2742022-07-05 11:15:17 -070012list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
Sherry Zhang4cb4aaf2022-12-08 13:25:31 +080013include(version)
Chris Brand19bf2742022-07-05 11:15:17 -070014include(remote_library)
Jianliang Shenbd624ed2023-10-24 15:42:59 +080015include(utils)
Gyorgy Szing30fa9872017-12-05 01:08:47 +000016
Anton Komlev4f864802023-09-05 16:57:15 +010017if(EXISTS ${CMAKE_SOURCE_DIR}/localrepos.cmake)
18 message(WARNING "Building using local repositories from \"" ${CMAKE_SOURCE_DIR}/localrepos.cmake "\"")
19 include(${CMAKE_SOURCE_DIR}/localrepos.cmake)
20endif()
21
Raef Coles9ec67e62020-07-10 09:40:35 +010022############################ CONFIGURATION #####################################
Kevin Pengd0e49712022-12-07 11:13:01 +080023include(config/pre_config.cmake)
Kevin Pengb9c99f02022-12-07 11:23:17 +080024
25if(USE_KCONFIG_TOOL)
26 include(${CMAKE_SOURCE_DIR}/config/kconfig.cmake)
27else()
28 include(${CMAKE_SOURCE_DIR}/config/set_config.cmake)
29endif()
30
Kevin Pengd0e49712022-12-07 11:13:01 +080031include(config/post_config.cmake)
Raef Coles69817322020-10-19 14:14:14 +010032
Raef Coles69817322020-10-19 14:14:14 +010033############################### Compiler configuration #########################
34
Raef Coles69817322020-10-19 14:14:14 +010035include(${TFM_TOOLCHAIN_FILE})
Anton Komlevdd0a7222023-09-19 18:49:39 +010036
37set(CMAKE_C_COMPILER_FORCED true)
38set(CMAKE_CXX_COMPILER_FORCED true)
Raef Coles69817322020-10-19 14:14:14 +010039
Rajkumar Kanagarajcd831592022-05-04 11:44:03 +020040project("Trusted Firmware M" VERSION ${TFM_VERSION} LANGUAGES C CXX ASM)
David Hu9e1b2632023-10-14 13:35:24 +080041tfm_toolchain_reload_compiler()
Raef Coles69817322020-10-19 14:14:14 +010042
Jackson Cooper-Driverc0249482024-07-09 10:34:36 +010043add_subdirectory(lib/backtrace)
Raef Coles9ec67e62020-07-10 09:40:35 +010044add_subdirectory(lib/ext)
Tamas Banb881bea2020-11-04 16:18:36 +000045add_subdirectory(lib/fih)
Jackson Cooper-Drivered984c92024-08-14 16:12:40 +010046add_subdirectory(lib/tfm_log)
47add_subdirectory(lib/tfm_log_unpriv)
48add_subdirectory(lib/tfm_vprintf)
Raef Coles9ec67e62020-07-10 09:40:35 +010049add_subdirectory(tools)
David Hu1a2d4832022-01-18 14:42:04 +080050add_subdirectory(secure_fw)
Raef Colesd97a7e72021-12-10 14:58:06 +000051
Raef Coles9ec67e62020-07-10 09:40:35 +010052add_subdirectory(interface)
53if(BL2)
54 add_subdirectory(bl2)
55endif()
Raef Coles9ec67e62020-07-10 09:40:35 +010056
Raef Coles15a37f82021-12-07 15:59:14 +000057if(BL1 AND PLATFORM_DEFAULT_BL1)
58 add_subdirectory(bl1/bl1_2)
59 add_subdirectory(bl1/bl1_1)
60endif()
61
Raef Colesd97a7e72021-12-10 14:58:06 +000062add_subdirectory(platform)
Raef Coles9ec67e62020-07-10 09:40:35 +010063
Raef Coles9ec67e62020-07-10 09:40:35 +010064if(CRYPTO_HW_ACCELERATOR)
65 add_subdirectory(platform/ext/accelerator)
66endif()
Chris Brand9edf0812022-07-05 14:18:42 -070067
David Hue3f0f422023-10-30 12:55:42 +080068if(IS_DIRECTORY ${CONFIG_TFM_TEST_DIR})
David Hua993bd92023-10-23 22:41:06 +080069 add_subdirectory(${CONFIG_TFM_TEST_DIR} ${CMAKE_CURRENT_BINARY_DIR}/tf-m-tests)
70endif()
71
Anton Komleva07180c2022-10-24 23:53:47 +010072############################ Config Check ######################################
73
74include(${CMAKE_SOURCE_DIR}/config/check_config.cmake)
75
76################################################################################
77
Chris Brand9edf0812022-07-05 14:18:42 -070078include(cmake/install.cmake)