blob: ecbae1d0d0d6635c5f92728a32f04cb8f9f442cb [file] [log] [blame]
Gyorgy Szing30fa9872017-12-05 01:08:47 +00001#-------------------------------------------------------------------------------
Raef Coles59cf5d82024-12-09 15:41:13 +00002# SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors
Gyorgy Szing30fa9872017-12-05 01:08:47 +00003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
David Hu1249f0d2023-12-04 22:57:56 +08008cmake_minimum_required(VERSION 3.21)
Gyorgy Szing30fa9872017-12-05 01:08:47 +00009
Chris Brand19bf2742022-07-05 11:15:17 -070010list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
Sherry Zhang4cb4aaf2022-12-08 13:25:31 +080011include(version)
Chris Brand19bf2742022-07-05 11:15:17 -070012include(remote_library)
Jianliang Shenbd624ed2023-10-24 15:42:59 +080013include(utils)
Gyorgy Szing30fa9872017-12-05 01:08:47 +000014
Anton Komlev4f864802023-09-05 16:57:15 +010015if(EXISTS ${CMAKE_SOURCE_DIR}/localrepos.cmake)
16 message(WARNING "Building using local repositories from \"" ${CMAKE_SOURCE_DIR}/localrepos.cmake "\"")
17 include(${CMAKE_SOURCE_DIR}/localrepos.cmake)
18endif()
19
Raef Coles9ec67e62020-07-10 09:40:35 +010020############################ CONFIGURATION #####################################
Raef Coles59cf5d82024-12-09 15:41:13 +000021
22set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "" FORCE)
23
Kevin Pengd0e49712022-12-07 11:13:01 +080024include(config/pre_config.cmake)
Kevin Pengb9c99f02022-12-07 11:23:17 +080025
26if(USE_KCONFIG_TOOL)
27 include(${CMAKE_SOURCE_DIR}/config/kconfig.cmake)
28else()
29 include(${CMAKE_SOURCE_DIR}/config/set_config.cmake)
30endif()
31
Kevin Pengd0e49712022-12-07 11:13:01 +080032include(config/post_config.cmake)
Raef Coles69817322020-10-19 14:14:14 +010033
Raef Coles69817322020-10-19 14:14:14 +010034############################### Compiler configuration #########################
35
Raef Coles69817322020-10-19 14:14:14 +010036include(${TFM_TOOLCHAIN_FILE})
Anton Komlevdd0a7222023-09-19 18:49:39 +010037
Rajkumar Kanagarajcd831592022-05-04 11:44:03 +020038project("Trusted Firmware M" VERSION ${TFM_VERSION} LANGUAGES C CXX ASM)
Raef Coles69817322020-10-19 14:14:14 +010039
Jackson Cooper-Driverc0249482024-07-09 10:34:36 +010040add_subdirectory(lib/backtrace)
Raef Coles9ec67e62020-07-10 09:40:35 +010041add_subdirectory(lib/ext)
Tamas Banb881bea2020-11-04 16:18:36 +000042add_subdirectory(lib/fih)
Jackson Cooper-Drivered984c92024-08-14 16:12:40 +010043add_subdirectory(lib/tfm_log)
44add_subdirectory(lib/tfm_log_unpriv)
45add_subdirectory(lib/tfm_vprintf)
Raef Coles9ec67e62020-07-10 09:40:35 +010046add_subdirectory(tools)
David Hu1a2d4832022-01-18 14:42:04 +080047add_subdirectory(secure_fw)
Raef Colesd97a7e72021-12-10 14:58:06 +000048
Raef Coles9ec67e62020-07-10 09:40:35 +010049add_subdirectory(interface)
50if(BL2)
51 add_subdirectory(bl2)
52endif()
Raef Coles9ec67e62020-07-10 09:40:35 +010053
Raef Coles15a37f82021-12-07 15:59:14 +000054if(BL1 AND PLATFORM_DEFAULT_BL1)
55 add_subdirectory(bl1/bl1_2)
56 add_subdirectory(bl1/bl1_1)
57endif()
58
Raef Colesd97a7e72021-12-10 14:58:06 +000059add_subdirectory(platform)
Raef Coles9ec67e62020-07-10 09:40:35 +010060
Raef Coles9ec67e62020-07-10 09:40:35 +010061if(CRYPTO_HW_ACCELERATOR)
62 add_subdirectory(platform/ext/accelerator)
63endif()
Chris Brand9edf0812022-07-05 14:18:42 -070064
David Hue3f0f422023-10-30 12:55:42 +080065if(IS_DIRECTORY ${CONFIG_TFM_TEST_DIR})
David Hua993bd92023-10-23 22:41:06 +080066 add_subdirectory(${CONFIG_TFM_TEST_DIR} ${CMAKE_CURRENT_BINARY_DIR}/tf-m-tests)
67endif()
68
Anton Komleva07180c2022-10-24 23:53:47 +010069############################ Config Check ######################################
70
71include(${CMAKE_SOURCE_DIR}/config/check_config.cmake)
72
73################################################################################
74
Anton Komlev8ab4f042025-06-03 21:13:07 +010075include(install)