Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
David Hu | 1a2d483 | 2022-01-18 14:42:04 +0800 | [diff] [blame] | 2 | # Copyright (c) 2020-2022, Arm Limited. All rights reserved. |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 8 | # Set to not download submodules if that option is available |
| 9 | if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0") |
| 10 | cmake_policy(SET CMP0097 NEW) |
| 11 | endif() |
| 12 | |
David Hu | 195cb5a | 2022-05-10 22:03:26 +0800 | [diff] [blame^] | 13 | # If NS app, secure regression test or non-secure regression test is enabled, |
| 14 | # fetch tf-m-tests repo. |
| 15 | # The conditiions are actually overlapped but it can make the logic more clear. |
| 16 | # Besides, the dependencies between NS app and regression tests will be |
| 17 | # optimized later. |
| 18 | if (NS OR TFM_S_REG_TEST OR TFM_NS_REG_TEST OR TEST_BL2 OR TEST_BL1_1 OR TEST_BL1_2) |
| 19 | # Set tf-m-tests repo config |
| 20 | include(${CMAKE_SOURCE_DIR}/lib/ext/tf-m-tests/repo_config_default.cmake) |
David Hu | 3d2121f | 2021-08-23 18:00:26 +0800 | [diff] [blame] | 21 | |
David Hu | 195cb5a | 2022-05-10 22:03:26 +0800 | [diff] [blame^] | 22 | include(FetchContent) |
| 23 | set(FETCHCONTENT_QUIET FALSE) |
David Hu | 3d2121f | 2021-08-23 18:00:26 +0800 | [diff] [blame] | 24 | |
David Hu | 195cb5a | 2022-05-10 22:03:26 +0800 | [diff] [blame^] | 25 | set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/lib/ext CACHE STRING "" FORCE) |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 26 | |
David Hu | 195cb5a | 2022-05-10 22:03:26 +0800 | [diff] [blame^] | 27 | if ("${TFM_TEST_REPO_PATH}" STREQUAL "DOWNLOAD") |
| 28 | FetchContent_Declare(tfm_test_repo |
| 29 | GIT_REPOSITORY https://git.trustedfirmware.org/TF-M/tf-m-tests.git |
| 30 | GIT_TAG ${TFM_TEST_REPO_VERSION} |
| 31 | GIT_PROGRESS TRUE |
| 32 | ) |
| 33 | |
| 34 | FetchContent_GetProperties(tfm_test_repo) |
| 35 | if(NOT tfm_test_repo_POPULATED) |
| 36 | FetchContent_Populate(tfm_test_repo) |
| 37 | set(TFM_TEST_REPO_PATH ${tfm_test_repo_SOURCE_DIR} CACHE PATH "Path to TFM-TEST repo (or DOWNLOAD to fetch automatically" FORCE) |
| 38 | endif() |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 39 | endif() |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 40 | |
David Hu | 195cb5a | 2022-05-10 22:03:26 +0800 | [diff] [blame^] | 41 | if ("${CMSIS_5_PATH}" STREQUAL DOWNLOAD) |
| 42 | set(CMSIS_5_PATH ${TFM_TEST_REPO_PATH}/CMSIS CACHE PATH "Path to CMSIS_5 (or DOWNLOAD to fetch automatically" FORCE) |
| 43 | endif() |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 44 | |
David Hu | 195cb5a | 2022-05-10 22:03:26 +0800 | [diff] [blame^] | 45 | if (NOT TFM_TEST_PATH) |
| 46 | set(TFM_TEST_PATH ${TFM_TEST_REPO_PATH}/test CACHE PATH "Path to TFM tests" FORCE) |
| 47 | endif() |
| 48 | |
| 49 | # Load TF-M regression test suites setting |
| 50 | if (TFM_NS_REG_TEST OR TFM_S_REG_TEST) |
| 51 | include(${TFM_TEST_PATH}/config/set_config.cmake) |
| 52 | endif() |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 53 | endif() |