Gyorgy Szing | 30fa987 | 2017-12-05 01:08:47 +0000 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 2 | # Copyright (c) 2017-2018, Arm Limited. All rights reserved. |
Gyorgy Szing | 30fa987 | 2017-12-05 01:08:47 +0000 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | #Definitions to compile the "secure services" 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 | # |
| 14 | #Outputs: |
| 15 | # Will modify include directories to make the source compile. |
| 16 | # ALL_SRC_C: C source files to be compiled will be added to this list. This shall be added to your add_executable or add_library command. |
| 17 | # ALL_SRC_CXX: C++ source files to be compiled will be added to this list. This shall be added to your add_executable or add_library command. |
| 18 | # ALL_SRC_ASM: assembly source files to be compiled will be added to this list. This shall be added to your add_executable or add_library command. |
| 19 | # Include directories will be modified by using the include_directories() commands as needed. |
| 20 | |
| 21 | #Get the current directory where this file is located. |
| 22 | set(CORE_TEST_DIR ${CMAKE_CURRENT_LIST_DIR}) |
| 23 | |
| 24 | #Check input variables |
| 25 | if (NOT DEFINED TFM_ROOT_DIR) |
| 26 | message(FATAL_ERROR "Please set TFM_ROOT_DIR before including this file.") |
| 27 | endif() |
| 28 | |
| 29 | if (NOT DEFINED ENABLE_CORE_TESTS) |
| 30 | message(FATAL_ERROR "Incomplete build configuration: ENABLE_CORE_TESTS is undefined. ") |
| 31 | elseif(ENABLE_CORE_TESTS) |
| 32 | list(APPEND ALL_SRC_C_S "${CORE_TEST_DIR}/tfm_core_test/tfm_ss_core_test.c" |
| 33 | "${CORE_TEST_DIR}/tfm_core_test/tfm_ss_core_test_veneers.c" |
| 34 | ) |
| 35 | endif() |
| 36 | |
| 37 | if (NOT DEFINED ENABLE_CORE_TESTS_2) |
| 38 | message(FATAL_ERROR "Incomplete build configuration: ENABLE_CORE_TESTS_2 is undefined. ") |
| 39 | elseif(ENABLE_CORE_TESTS_2) |
| 40 | list(APPEND ALL_SRC_C_S "${CORE_TEST_DIR}/tfm_core_test_2/tfm_ss_core_test_2_veneers.c" |
| 41 | "${CORE_TEST_DIR}/tfm_core_test_2/tfm_ss_core_test_2.c" |
| 42 | ) |
| 43 | endif() |
| 44 | |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 45 | if (NOT DEFINED TFM_PARTITION_TEST_SST) |
| 46 | message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_TEST_SST is undefined. ") |
| 47 | elseif (TFM_PARTITION_TEST_SST) |
Jamie Fox | 5592db0 | 2017-12-18 16:48:29 +0000 | [diff] [blame] | 48 | list(APPEND ALL_SRC_C_S "${CORE_TEST_DIR}/tfm_sst_test_service/sst_test_service.c" |
| 49 | "${CORE_TEST_DIR}/tfm_sst_test_service/sst_test_service_veneers.c" |
| 50 | ) |
| 51 | |
Mate Toth-Pal | 1379e15 | 2018-07-30 17:38:29 +0200 | [diff] [blame] | 52 | list(APPEND ALL_SRC_C_NS "${CORE_TEST_DIR}/tfm_sst_test_service/sst_test_service_api.c") |
Jamie Fox | 5592db0 | 2017-12-18 16:48:29 +0000 | [diff] [blame] | 53 | endif() |
| 54 | |
Ben Davis | 6d7256b | 2018-04-18 14:16:53 +0100 | [diff] [blame] | 55 | if (NOT DEFINED TFM_PARTITION_TEST_SECURE_SERVICES) |
| 56 | message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_TEST_SECURE_SERVICES is undefined. ") |
| 57 | elseif (TFM_PARTITION_TEST_SECURE_SERVICES) |
| 58 | list(APPEND ALL_SRC_C_S "${CORE_TEST_DIR}/tfm_secure_client_service/tfm_secure_client_service.c" |
| 59 | "${CORE_TEST_DIR}/tfm_secure_client_service/tfm_secure_client_service_veneers.c" |
| 60 | ) |
| 61 | |
Mate Toth-Pal | 1379e15 | 2018-07-30 17:38:29 +0200 | [diff] [blame] | 62 | list(APPEND ALL_SRC_C_NS "${CORE_TEST_DIR}/tfm_secure_client_service/tfm_secure_client_service_api.c") |
Ben Davis | 6d7256b | 2018-04-18 14:16:53 +0100 | [diff] [blame] | 63 | endif() |
| 64 | |
Gyorgy Szing | 30fa987 | 2017-12-05 01:08:47 +0000 | [diff] [blame] | 65 | embedded_include_directories(PATH ${TFM_ROOT_DIR} ABSOLUTE) |
| 66 | embedded_include_directories(PATH ${TFM_ROOT_DIR}/interface/include ABSOLUTE) |
| 67 | |
Marc Moreno Berengue | a1f296f | 2018-01-25 15:21:22 +0000 | [diff] [blame] | 68 | set(BUILD_CMSIS_CORE Off) |
| 69 | set(BUILD_RETARGET Off) |
| 70 | set(BUILD_NATIVE_DRIVERS Off) |
| 71 | set(BUILD_STARTUP Off) |
| 72 | set(BUILD_TARGET_CFG Off) |
| 73 | set(BUILD_TARGET_HARDWARE_KEYS Off) |
Marc Moreno Berengue | 4cc81fc | 2018-08-10 14:32:01 +0100 | [diff] [blame] | 74 | set(BUILD_TARGET_NV_COUNTERS Off) |
Marc Moreno Berengue | a1f296f | 2018-01-25 15:21:22 +0000 | [diff] [blame] | 75 | set(BUILD_CMSIS_DRIVERS Off) |
| 76 | set(BUILD_TIME Off) |
| 77 | set(BUILD_UART_STDOUT Off) |
| 78 | set(BUILD_FLASH Off) |
| 79 | if(NOT DEFINED PLATFORM_CMAKE_FILE) |
| 80 | message (FATAL_ERROR "Platform specific CMake is not defined. Please set PLATFORM_CMAKE_FILE.") |
| 81 | elseif(NOT EXISTS ${PLATFORM_CMAKE_FILE}) |
| 82 | message (FATAL_ERROR "Platform specific CMake \"${PLATFORM_CMAKE_FILE}\" file does not exist. Please fix value of PLATFORM_CMAKE_FILE.") |
| 83 | else() |
| 84 | include(${PLATFORM_CMAKE_FILE}) |
| 85 | endif() |