Anton Komlev | 84283b0 | 2023-08-16 10:57:56 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2023, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | cmake_minimum_required(VERSION 3.15) |
| 8 | |
| 9 | if (NOT DEFINED CONFIG_SPE_PATH OR NOT EXISTS ${CONFIG_SPE_PATH}) |
| 10 | message(FATAL_ERROR "CONFIG_SPE_PATH = ${CONFIG_SPE_PATH} is not defined or incorrect. Please provide full path to TF-M build artifacts using -DCONFIG_SPE_PATH=") |
| 11 | endif() |
| 12 | |
| 13 | if (NOT DEFINED CMAKE_TOOLCHAIN_FILE) |
| 14 | set(CROSS_COMPILE arm-none-eabi) |
| 15 | set(CMAKE_TOOLCHAIN_FILE ${CONFIG_SPE_PATH}/cmake/toolchain_ns_GNUARM.cmake) |
| 16 | endif() |
| 17 | |
| 18 | #--- Test configuration -------------------------------------------------------- |
| 19 | # include(../test/config/default_ns_test_config.cmake) |
| 20 | # Temporary hardcoded. Need better mechnism of NS tests selectoin |
| 21 | |
| 22 | set(TFM_NS_REG_TEST ON) |
| 23 | set(NS ON) |
| 24 | set(TEST_NS ON) |
| 25 | |
| 26 | set(TEST_NS_ATTESTATION OFF CACHE BOOL "Whether to build NS regression Attestation tests") |
| 27 | set(TEST_NS_T_COSE OFF CACHE BOOL "Whether to build NS regression t_cose tests") |
| 28 | set(TEST_NS_CRYPTO ON CACHE BOOL "Whether to build NS regression Crypto tests") |
| 29 | set(TEST_NS_ITS ON CACHE BOOL "Whether to build NS regression ITS tests") |
| 30 | set(TEST_NS_PS ON CACHE BOOL "Whether to build NS regression PS tests") |
| 31 | set(TEST_NS_PLATFORM ON CACHE BOOL "Whether to build NS regression Platform tests") |
| 32 | set(TEST_NS_FWU OFF CACHE BOOL "Whether to build NS regression FWU tests") |
| 33 | set(TEST_NS_MULTI_CORE OFF CACHE BOOL "Whether to build NS regression multi-core tests") |
| 34 | set(TEST_NS_MANAGE_NSID OFF CACHE BOOL "Whether to build NS regression NSID management tests") |
| 35 | #------------------------------------------------------------------------------ |
| 36 | |
| 37 | # Include default test configurations (this not about which test suites to enable or disable) |
| 38 | include(${CMAKE_CURRENT_LIST_DIR}/test/config/default_test_config.cmake) |
| 39 | |
| 40 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../cmake) |
| 41 | list(APPEND CMAKE_MODULE_PATH ${CONFIG_SPE_PATH}/cmake) |
Kevin Peng | aa32cdf | 2023-09-11 10:38:22 +0800 | [diff] [blame] | 42 | include(remote_library) |
| 43 | |
| 44 | add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../lib/ext ${CMAKE_BINARY_DIR}/lib/ext) |
Anton Komlev | 84283b0 | 2023-08-16 10:57:56 +0100 | [diff] [blame] | 45 | |
| 46 | project(tfm_ns LANGUAGES C) |
| 47 | |
| 48 | add_executable(tfm_ns) |
| 49 | |
Anton Komlev | c0ad604 | 2023-08-29 18:23:26 +0100 | [diff] [blame] | 50 | add_subdirectory(../app_broker ${CMAKE_BINARY_DIR}/app_broker) |
Anton Komlev | e4b96ad | 2023-09-05 17:09:28 +0100 | [diff] [blame] | 51 | add_subdirectory(test) |
Anton Komlev | 84283b0 | 2023-08-16 10:57:56 +0100 | [diff] [blame] | 52 | |
| 53 | ############################# TFM NS main app ################################## |
| 54 | |
| 55 | target_sources(tfm_ns |
| 56 | PRIVATE |
| 57 | test_app.c |
| 58 | ) |
| 59 | |
| 60 | target_link_libraries(tfm_ns |
| 61 | PRIVATE |
| 62 | tfm_test_broker |
| 63 | tfm_ns_tests |
| 64 | tfm_test_framework_common |
| 65 | ) |
| 66 | |
| 67 | set_target_properties(tfm_ns PROPERTIES |
| 68 | SUFFIX ".axf" |
| 69 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" |
| 70 | ) |