Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame^] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2020, Arm Limited. All rights reserved. |
| 3 | # |
| 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 | |
| 12 | # First load defaults. |
| 13 | include(${CMAKE_SOURCE_DIR}/config/config_default.cmake) |
| 14 | |
| 15 | # Then load the build type config, overriding defaults and command line. |
| 16 | string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWERCASE) |
| 17 | if (EXISTS ${CMAKE_SOURCE_DIR}/config/build_type/${CMAKE_BUILD_TYPE_LOWERCASE}.cmake) |
| 18 | include(${CMAKE_SOURCE_DIR}/config/build_type/${CMAKE_BUILD_TYPE_LOWERCASE}.cmake) |
| 19 | endif() |
| 20 | |
| 21 | # If configured for tests, load config specific to tests overriding defaults. |
| 22 | if (TEST_PSA_API) |
| 23 | include(${CMAKE_SOURCE_DIR}/config/tests/config_test_psa_api.cmake) |
| 24 | endif() |
| 25 | |
| 26 | # Then load the profile, overriding build type config, defaults and command |
| 27 | # line. |
| 28 | if (TFM_PROFILE) |
| 29 | include(${CMAKE_SOURCE_DIR}/config/profile/${TFM_PROFILE}.cmake) |
| 30 | endif() |
| 31 | |
| 32 | # Then load the platform options, overriding profile, build type config, |
| 33 | # defaults and command line. |
| 34 | if (EXISTS ${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/config.cmake) |
| 35 | include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/config.cmake) |
| 36 | endif() |
| 37 | |
| 38 | # If CRYPTO_HW_ACCELERATOR is enabled by the platform, then load the |
| 39 | # corresponding config if it exists |
| 40 | if (CRYPTO_HW_ACCELERATOR AND EXISTS ${CMAKE_SOURCE_DIR}/platform/ext/accelerator/${CRYPTO_HW_ACCELERATOR_TYPE}/config.cmake) |
| 41 | include(${CMAKE_SOURCE_DIR}/platform/ext/accelerator/${CRYPTO_HW_ACCELERATOR_TYPE}/config.cmake) |
| 42 | endif() |
| 43 | |
| 44 | # Optionally load extra config, overriding platform options, overriding profile, |
| 45 | # build type config, defaults and command line. |
| 46 | if (TFM_EXTRA_CONFIG_PATH) |
| 47 | include(${TFM_EXTRA_CONFIG_PATH}) |
| 48 | endif() |
| 49 | |
| 50 | include(${CMAKE_SOURCE_DIR}/config/check_config.cmake) |