blob: 55ae9205dc6d79ab36e26e0ca636f3b85e4409fe [file] [log] [blame]
Mingyang Sunc4b5d8d2019-07-16 17:57:52 +08001#-------------------------------------------------------------------------------
2# Copyright (c) 2019, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8#Definations to compile the "libtfmsprt" module.
9#This file assumes it will be included from a project specific cmakefile, and
10#will not create a library or executable.
11#Inputs:
12# TFM_ROOT_DIR - root directory of the TF-M repository.
13#Outputs:
14# Will modify include directories to make the source compile.
15# ALL_SRC_C_S: C source files to be compiled will be added to this list. This shall be added to your add_executable or add_library command.
16# ALL_SRC_CXX_S: C++ source files to be compiled will be added to this list. This shaall be added to your add_executable or add_library command.
17# ALL_SRC_ASM_S: assembly source files to be compiled will be added to this list. This shall be added to your add_executable or add_library command.
18# Include directories will be modified by using the include_directories() commands as needed.
19
20#Get the current directory where this file is located.
21set(LIBSPRT_DIR ${CMAKE_CURRENT_LIST_DIR})
22
23if(NOT DEFINED TFM_ROOT_DIR)
24 message(FATAL_ERROR "Please set TFM_ROOT_DIR before including this file.")
25endif()
26
27set (LIBSPRT_C_SRC
28 "${LIBSPRT_DIR}/tfm_libsprt_c_memcpy.c"
Mingyang Sunc6b458b2019-12-19 15:07:34 +080029 "${LIBSPRT_DIR}/tfm_libsprt_c_memmove.c"
Shawn Shanb47ba8b2019-07-12 16:15:44 +080030 "${LIBSPRT_DIR}/tfm_libsprt_c_memcmp.c"
Mingyang Sunc6b458b2019-12-19 15:07:34 +080031 "${TFM_ROOT_DIR}/interface/src/log/tfm_log_raw.c")
Mingyang Sunc4b5d8d2019-07-16 17:57:52 +080032
Summer Qin254ee972019-10-18 17:36:04 +080033if (TFM_PSA_API)
34 list(APPEND LIBSPRT_C_SRC
35 "${TFM_ROOT_DIR}/interface/src/psa/psa_client.c"
36 "${TFM_ROOT_DIR}/interface/src/psa/psa_service.c"
37 )
38endif()
39
Mingyang Sunc4b5d8d2019-07-16 17:57:52 +080040#Append all our source files to global lists.
41list(APPEND ALL_SRC_C_S ${LIBSPRT_C_SRC})
42unset(LIBSPRT_C_SRC)
Mingyang Sunc6b458b2019-12-19 15:07:34 +080043
44#Setting include directories
45embedded_include_directories(PATH ${TFM_ROOT_DIR}/interface/include ABSOLUTE)