blob: 94ac087b7b0276eb8f670406c03b0bd94917281c [file] [log] [blame]
Anton Komlev84283b02023-08-16 10:57:56 +01001#-------------------------------------------------------------------------------
2# Copyright (c) 2023, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7cmake_minimum_required(VERSION 3.15)
8
9if (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=")
11endif()
12
13if (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)
16endif()
17
18#--- Test configuration --------------------------------------------------------
19# include(../test/config/default_ns_test_config.cmake)
20# Temporary hardcoded. Need better mechnism of NS tests selectoin
21
22set(TFM_NS_REG_TEST ON)
23set(NS ON)
24set(TEST_NS ON)
25
26set(TEST_NS_ATTESTATION OFF CACHE BOOL "Whether to build NS regression Attestation tests")
27set(TEST_NS_T_COSE OFF CACHE BOOL "Whether to build NS regression t_cose tests")
28set(TEST_NS_CRYPTO ON CACHE BOOL "Whether to build NS regression Crypto tests")
29set(TEST_NS_ITS ON CACHE BOOL "Whether to build NS regression ITS tests")
30set(TEST_NS_PS ON CACHE BOOL "Whether to build NS regression PS tests")
31set(TEST_NS_PLATFORM ON CACHE BOOL "Whether to build NS regression Platform tests")
32set(TEST_NS_FWU OFF CACHE BOOL "Whether to build NS regression FWU tests")
33set(TEST_NS_MULTI_CORE OFF CACHE BOOL "Whether to build NS regression multi-core tests")
34set(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)
38include(${CMAKE_CURRENT_LIST_DIR}/test/config/default_test_config.cmake)
39
40list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../cmake)
41list(APPEND CMAKE_MODULE_PATH ${CONFIG_SPE_PATH}/cmake)
Kevin Pengaa32cdf2023-09-11 10:38:22 +080042include(remote_library)
43
44add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../lib/ext ${CMAKE_BINARY_DIR}/lib/ext)
Anton Komlev84283b02023-08-16 10:57:56 +010045
46project(tfm_ns LANGUAGES C)
47
48add_executable(tfm_ns)
49
Anton Komlevc0ad6042023-08-29 18:23:26 +010050add_subdirectory(../app_broker ${CMAKE_BINARY_DIR}/app_broker)
Anton Komleve4b96ad2023-09-05 17:09:28 +010051add_subdirectory(test)
Anton Komlev84283b02023-08-16 10:57:56 +010052
53############################# TFM NS main app ##################################
54
55target_sources(tfm_ns
56 PRIVATE
57 test_app.c
58)
59
60target_link_libraries(tfm_ns
61 PRIVATE
62 tfm_test_broker
63 tfm_ns_tests
64 tfm_test_framework_common
65)
66
67set_target_properties(tfm_ns PROPERTIES
68 SUFFIX ".axf"
69 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
70)