1#-------------------------------------------------------------------------------
2# Copyright (c) 2021-2024, Arm Limited. All rights reserved.
3# Copyright (c) 2021-2022 Cypress Semiconductor Corporation (an Infineon company)
4# or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
5#
6# SPDX-License-Identifier: BSD-3-Clause
7#
8#-------------------------------------------------------------------------------
9
10if (NOT TFM_PARTITION_NS_AGENT_MAILBOX)
11    return()
12endif()
13
14cmake_minimum_required(VERSION 3.21)
15
16add_library(tfm_psa_rot_partition_ns_agent_mailbox STATIC)
17
18add_dependencies(tfm_psa_rot_partition_ns_agent_mailbox manifest_tool)
19
20target_sources(tfm_psa_rot_partition_ns_agent_mailbox
21    PRIVATE
22        ${CMAKE_SOURCE_DIR}/secure_fw/spm/core/tfm_rpc.c
23        $<$<NOT:$<BOOL:${TFM_PLAT_SPECIFIC_MULTI_CORE_COMM}>>:tfm_spe_mailbox.c>
24        ns_agent_mailbox.c
25        tfm_multi_core_mem_check.c
26        tfm_multi_core_client_id.c
27)
28
29target_link_libraries(tfm_psa_rot_partition_ns_agent_mailbox
30    PRIVATE
31        platform_common_interface
32        tfm_spm
33        tfm_sprt
34        platform_s
35)
36
37# The generated sources
38target_sources(tfm_psa_rot_partition_ns_agent_mailbox
39    PRIVATE
40        ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/ns_agent_mailbox/auto_generated/intermedia_ns_agent_mailbox.c
41)
42target_sources(tfm_partitions
43    INTERFACE
44        ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/ns_agent_mailbox/auto_generated/load_info_ns_agent_mailbox.c
45)
46
47# Set include directory
48target_include_directories(tfm_psa_rot_partition_ns_agent_mailbox
49    PRIVATE
50        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
51    PUBLIC
52        ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/ns_agent_mailbox
53)
54
55############################ Partition Defs ####################################
56
57target_link_libraries(tfm_partitions
58    INTERFACE
59        tfm_psa_rot_partition_ns_agent_mailbox
60)
61
62target_compile_definitions(tfm_config
63    INTERFACE
64        TFM_PARTITION_NS_AGENT_MAILBOX
65)
66