Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 2 | # Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved. |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | #------------------------------------------------------------------------------- |
| 8 | # The CMakeLists.txt for building the spm-test sp deployment for opteesp |
| 9 | # |
| 10 | # Used for building the SPs used in the spm test. The SP can be build twice |
| 11 | # , to be able to test inter SPs communication. This is done by passing the |
| 12 | # -DSP_NUMBER=1 parameter. |
| 13 | #------------------------------------------------------------------------------- |
| 14 | target_include_directories(spm-test${SP_NUMBER} PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}") |
| 15 | |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 16 | #------------------------------------------------------------------------------- |
| 17 | # Extend with components that are common across all deployments of |
| 18 | # spm-test |
| 19 | # |
| 20 | #------------------------------------------------------------------------------- |
| 21 | target_include_directories(spm-test${SP_NUMBER} PRIVATE |
| 22 | ${TS_ROOT} |
| 23 | ${TS_ROOT}/components |
| 24 | ) |
| 25 | |
| 26 | #------------------------------------------------------------------------------- |
| 27 | # Set target platform to provide drivers needed by the deployment |
| 28 | # |
| 29 | #------------------------------------------------------------------------------- |
| 30 | add_platform(TARGET spm-test${SP_NUMBER}) |
| 31 | |
| 32 | ################################################################# |
| 33 | |
| 34 | target_compile_definitions(spm-test${SP_NUMBER} PRIVATE |
| 35 | ARM64=1 |
| 36 | ) |
| 37 | |
| 38 | target_include_directories(spm-test${SP_NUMBER} PRIVATE |
| 39 | ${TS_ROOT}/components/service/spm_test |
| 40 | ) |
| 41 | |
Gyorgy Szing | 34aaf21 | 2022-10-20 07:26:23 +0200 | [diff] [blame] | 42 | if(CMAKE_C_COMPILER_ID STREQUAL "GNU") |
| 43 | target_compile_options(spm-test${SP_NUMBER} PRIVATE |
| 44 | -std=c99 |
| 45 | ) |
| 46 | endif() |
| 47 | |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 48 | #------------------------------------------------------------------------------- |
| 49 | # Deployment specific source files |
| 50 | #------------------------------------------------------------------------------- |
| 51 | target_sources(spm-test${SP_NUMBER} PRIVATE |
| 52 | ${TS_ROOT}/components/service/spm_test/sp.c |
| 53 | ) |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 54 | |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 55 | ######################################## install |
| 56 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 57 | set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE) |
| 58 | endif() |
| 59 | |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 60 | install(TARGETS spm-test${SP_NUMBER} |
| 61 | PUBLIC_HEADER DESTINATION ${TS_ENV}/include |
| 62 | RUNTIME DESTINATION ${TS_ENV}/bin |
| 63 | ) |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 64 | |
| 65 | include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake) |
| 66 | export_sp( |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 67 | SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON} |
Gyorgy Szing | 3e3db70 | 2023-07-21 14:18:19 +0200 | [diff] [blame] | 68 | SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON} |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 69 | SP_NAME "spm-test${SP_NUMBER}" |
| 70 | MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in |
| 71 | DTS_IN ${TS_ROOT}/deployments/spm-test${SP_NUMBER}/opteesp/default_spm_test${SP_NUMBER}.dts.in |
| 72 | JSON_IN ${TS_ROOT}/environments/opteesp/sp_pkg.json.in |
| 73 | ) |