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) |
| 42 | |
| 43 | project(tfm_ns LANGUAGES C) |
| 44 | |
| 45 | add_executable(tfm_ns) |
| 46 | |
| 47 | add_subdirectory(../ns_interface ${CMAKE_BINARY_DIR}/ns_interface) |
| 48 | add_subdirectory(../test ${CMAKE_BINARY_DIR}/tests) |
| 49 | |
| 50 | ############################# TFM NS main app ################################## |
| 51 | |
| 52 | target_sources(tfm_ns |
| 53 | PRIVATE |
| 54 | test_app.c |
| 55 | ) |
| 56 | |
| 57 | target_link_libraries(tfm_ns |
| 58 | PRIVATE |
| 59 | tfm_test_broker |
| 60 | tfm_ns_tests |
| 61 | tfm_test_framework_common |
| 62 | ) |
| 63 | |
| 64 | set_target_properties(tfm_ns PROPERTIES |
| 65 | SUFFIX ".axf" |
| 66 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" |
| 67 | ) |