Anton Komlev | 94758d4 | 2023-06-15 16:39:36 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 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 | # |
| 11 | cmake_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 |
| 15 | add_subdirectory(${CONFIG_SPE_PATH} ${CMAKE_BINARY_DIR}/spe) |
| 16 | |
| 17 | add_subdirectory(../log ${CMAKE_BINARY_DIR}/log) |
| 18 | add_subdirectory(../CMSIS ${CMAKE_BINARY_DIR}/CMSIS) |
| 19 | |
| 20 | add_library(tfm_test_broker STATIC) |
| 21 | |
| 22 | target_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 | |
| 29 | target_include_directories(tfm_test_broker |
| 30 | PUBLIC |
| 31 | . |
| 32 | ../app |
| 33 | ) |
| 34 | |
| 35 | target_link_libraries(tfm_test_broker |
| 36 | PUBLIC |
| 37 | RTX_OS |
| 38 | tfm_api_ns |
| 39 | tfm_log |
| 40 | ) |
| 41 | |
| 42 | add_subdirectory(ns_client_ext) |
| 43 | target_link_libraries(tfm_test_broker PUBLIC tfm_nsid_manager) |
| 44 | |
| 45 | if (TFM_PARTITION_NS_AGENT_MAILBOX) |
| 46 | add_subdirectory(multi_core) |
| 47 | target_link_libraries(tfm_test_broker PUBLIC ns_multi_core) |
| 48 | endif() |
| 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 |
| 56 | add_library(platform_common_interface INTERFACE) |
| 57 | |
| 58 | # platform_region_defs needed by PS tests |
| 59 | add_library(platform_region_defs INTERFACE) |
| 60 | |
| 61 | # stub the tfm_partition target. |
| 62 | add_library(tfm_partitions INTERFACE) |
| 63 | |
| 64 | target_link_libraries(platform_common_interface |
| 65 | INTERFACE |
| 66 | platform_ns |
| 67 | ) |
| 68 | |
| 69 | target_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 | |
| 74 | target_include_directories(tfm_config |
| 75 | INTERFACE |
| 76 | ${CMAKE_CURRENT_SOURCE_DIR} |
| 77 | ) |