blob: 1d9f901ed21cd1fc5cb6340fe377f061d1c7ec4d [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
Kevin Peng21613562023-09-04 14:39:28 +080018# Platform abilities for example IRQ test support status
19include(${CONFIG_SPE_PATH}/platform/config.cmake OPTIONAL)
Anton Komlev84283b02023-08-16 10:57:56 +010020
21set(TFM_NS_REG_TEST ON)
22set(NS ON)
Anton Komlev84283b02023-08-16 10:57:56 +010023
Kevin Peng21613562023-09-04 14:39:28 +080024# Test suite configurations - set up by SPE build
25include(${CONFIG_SPE_PATH}/config_ns_test.cmake)
Anton Komlev84283b02023-08-16 10:57:56 +010026
Kevin Peng21613562023-09-04 14:39:28 +080027# Test configurations
Anton Komlev84283b02023-08-16 10:57:56 +010028include(${CMAKE_CURRENT_LIST_DIR}/test/config/default_test_config.cmake)
29
30list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../cmake)
31list(APPEND CMAKE_MODULE_PATH ${CONFIG_SPE_PATH}/cmake)
Kevin Pengaa32cdf2023-09-11 10:38:22 +080032include(remote_library)
33
34add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../lib/ext ${CMAKE_BINARY_DIR}/lib/ext)
Anton Komlev84283b02023-08-16 10:57:56 +010035
36project(tfm_ns LANGUAGES C)
37
38add_executable(tfm_ns)
39
Anton Komlevc0ad6042023-08-29 18:23:26 +010040add_subdirectory(../app_broker ${CMAKE_BINARY_DIR}/app_broker)
Anton Komleve4b96ad2023-09-05 17:09:28 +010041add_subdirectory(test)
Anton Komlev84283b02023-08-16 10:57:56 +010042
43############################# TFM NS main app ##################################
44
45target_sources(tfm_ns
46 PRIVATE
47 test_app.c
48)
49
50target_link_libraries(tfm_ns
51 PRIVATE
52 tfm_test_broker
53 tfm_ns_tests
54 tfm_test_framework_common
55)
56
57set_target_properties(tfm_ns PROPERTIES
58 SUFFIX ".axf"
59 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
60)