1#-------------------------------------------------------------------------------
2# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7if(NOT DEFINED TGT)
8	message(FATAL_ERROR "mandatory parameter TGT is not defined.")
9endif()
10
11include(${TS_ROOT}/external/LinuxFFAUserShim/LinuxFFAUserShim.cmake)
12
13if(NOT MM_COMM_BUFFER_ADDRESS OR NOT MM_COMM_BUFFER_SIZE)
14	message(FATAL_ERROR "Address and size of MM comm buffer is not set. Define MM_COMM_BUFFER_ADDRESS "
15						"and MM_COMM_BUFFER_SIZE.")
16endif()
17
18target_compile_definitions(${TGT} PRIVATE MM_COMM_BUFFER_ADDRESS=${MM_COMM_BUFFER_ADDRESS}
19									MM_COMM_BUFFER_SIZE=${MM_COMM_BUFFER_SIZE})
20
21target_sources(${TGT} PRIVATE
22	"${CMAKE_CURRENT_LIST_DIR}/mm_communicate_caller.c"
23	"${CMAKE_CURRENT_LIST_DIR}/mm_communicate_serializer.c"
24	"${CMAKE_CURRENT_LIST_DIR}/carveout.c"
25)
26
27target_include_directories(${TGT} PRIVATE
28	"${LINUX_FFA_USER_SHIM_INCLUDE_DIR}"
29)
30