blob: 0c6990b156f06a92cbd51fa0c7207593e8053189 [file] [log] [blame]
Anton Komlev94758d42023-06-15 16:39:36 +01001#-------------------------------------------------------------------------------
2# Copyright (c) 2023, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7#
8# This CMake script used in a split build only. In the legacy 'sinlge' build
9# this file is ignoed. Please don't be confused.
10#
11cmake_minimum_required(VERSION 3.15)
12
13# This is important to add this SPE subdirectory at first as it
14# brings configuration from TF-M build
15add_subdirectory(${CONFIG_SPE_PATH} ${CMAKE_BINARY_DIR}/spe)
16
17add_subdirectory(../log ${CMAKE_BINARY_DIR}/log)
18add_subdirectory(../CMSIS ${CMAKE_BINARY_DIR}/CMSIS)
19
20add_library(tfm_test_broker STATIC)
21
22target_sources(tfm_test_broker
23 PUBLIC
24 ../app/main_ns.c
25 ../app/os_wrapper_cmsis_rtos_v2.c
26 ns_client_ext/tz_shim_layer.c
27)
28
29target_include_directories(tfm_test_broker
30 PUBLIC
31 .
32 ../app
33)
34
35target_link_libraries(tfm_test_broker
36 PUBLIC
37 RTX_OS
38 tfm_api_ns
39 tfm_log
40)
41
42add_subdirectory(ns_client_ext)
43target_link_libraries(tfm_test_broker PUBLIC tfm_nsid_manager)
44
45if (TFM_PARTITION_NS_AGENT_MAILBOX)
46 add_subdirectory(multi_core)
47 target_link_libraries(tfm_test_broker PUBLIC ns_multi_core)
48endif()
49
50################################################################################
51########### Patches and stubs to the existing (single) build process to leave
52# legacy code untouched for backwrd compatibility.
53# TODO: Sort it out after single build deprecation and code restructuring
54
55# platform_common_interface target is linked to the log target only
56add_library(platform_common_interface INTERFACE)
57
58# platform_region_defs needed by PS tests
59add_library(platform_region_defs INTERFACE)
60
61# stub the tfm_partition target.
62add_library(tfm_partitions INTERFACE)
63
64target_link_libraries(platform_common_interface
65 INTERFACE
66 platform_ns
67)
68
69target_include_directories(tfm_test_broker
70 PUBLIC
71 ns_client_ext # TODO: It shall be in tfm_nsid_manager. Need to sort out dependencies
72)
73
74target_include_directories(tfm_config
75 INTERFACE
76 ${CMAKE_CURRENT_SOURCE_DIR}
77)