Balint Dobszay | 72c3f04 | 2020-11-23 18:23:57 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Gyorgy Szing | 8a1e7f4 | 2023-07-26 18:26:48 +0200 | [diff] [blame] | 2 | # Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved. |
Balint Dobszay | 72c3f04 | 2020-11-23 18:23:57 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
Balint Dobszay | 047aea8 | 2022-05-16 14:20:53 +0200 | [diff] [blame] | 7 | cmake_minimum_required(VERSION 3.18 FATAL_ERROR) |
Balint Dobszay | 72c3f04 | 2020-11-23 18:23:57 +0100 | [diff] [blame] | 8 | include(../../deployment.cmake REQUIRED) |
| 9 | |
| 10 | #------------------------------------------------------------------------------- |
| 11 | # The CMakeLists.txt for building the sfs-demo deployment for opteesp |
| 12 | # |
| 13 | # Used for building a demo sp that acts as a client of the secure storage |
| 14 | # service, deployed in another sp. |
| 15 | #------------------------------------------------------------------------------- |
| 16 | include(${TS_ROOT}/environments/opteesp/env.cmake) |
| 17 | project(trusted-services LANGUAGES C ASM) |
| 18 | add_executable(sfs-demo) |
Balint Dobszay | c9daea9 | 2022-06-15 15:17:11 +0200 | [diff] [blame] | 19 | set(SP_UUID_CANON "01109cf8-e5ca-446f-9b55-f3cdc65110c8") |
Imre Kis | eeee964 | 2021-12-17 13:59:46 +0100 | [diff] [blame] | 20 | set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes") |
Imre Kis | 2ccd8e8 | 2021-10-08 11:21:14 +0200 | [diff] [blame] | 21 | set(TRACE_PREFIX "SFSDEMO" CACHE STRING "Trace prefix") |
Balint Dobszay | 72c3f04 | 2020-11-23 18:23:57 +0100 | [diff] [blame] | 22 | |
Balint Dobszay | 72c3f04 | 2020-11-23 18:23:57 +0100 | [diff] [blame] | 23 | add_components(TARGET "sfs-demo" |
| 24 | BASE_DIR ${TS_ROOT} |
| 25 | COMPONENTS |
Balint Dobszay | 72c3f04 | 2020-11-23 18:23:57 +0100 | [diff] [blame] | 26 | environments/opteesp |
| 27 | ) |
| 28 | |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 29 | include(../sfs-demo.cmake REQUIRED) |
Balint Dobszay | 72c3f04 | 2020-11-23 18:23:57 +0100 | [diff] [blame] | 30 | |
| 31 | target_compile_definitions(sfs-demo PRIVATE |
| 32 | ARM64=1 |
| 33 | ) |
| 34 | |
| 35 | target_include_directories(sfs-demo PRIVATE |
Balint Dobszay | 72c3f04 | 2020-11-23 18:23:57 +0100 | [diff] [blame] | 36 | ${TS_ROOT}/deployments/sfs-demo/opteesp |
| 37 | ) |
| 38 | |
| 39 | if(CMAKE_C_COMPILER_ID STREQUAL "GNU") |
| 40 | target_compile_options(sfs-demo PRIVATE |
Andrew Beggs | 97a00d4 | 2021-06-15 15:45:46 +0000 | [diff] [blame] | 41 | -std=c99 |
Balint Dobszay | 72c3f04 | 2020-11-23 18:23:57 +0100 | [diff] [blame] | 42 | ) |
| 43 | |
Balint Dobszay | 72c3f04 | 2020-11-23 18:23:57 +0100 | [diff] [blame] | 44 | endif() |
| 45 | |
Balint Dobszay | 72c3f04 | 2020-11-23 18:23:57 +0100 | [diff] [blame] | 46 | ######################################## install |
| 47 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 48 | set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE) |
| 49 | endif() |
Imre Kis | 5a35dda | 2022-03-03 11:38:12 +0100 | [diff] [blame] | 50 | install(TARGETS sfs-demo |
| 51 | PUBLIC_HEADER DESTINATION ${TS_ENV}/include |
| 52 | RUNTIME DESTINATION ${TS_ENV}/bin |
| 53 | ) |
Imre Kis | 5a35dda | 2022-03-03 11:38:12 +0100 | [diff] [blame] | 54 | |
| 55 | include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake) |
| 56 | export_sp( |
Balint Dobszay | c9daea9 | 2022-06-15 15:17:11 +0200 | [diff] [blame] | 57 | SP_UUID_CANON ${SP_UUID_CANON} |
Imre Kis | 5a35dda | 2022-03-03 11:38:12 +0100 | [diff] [blame] | 58 | SP_NAME "sfs-demo" |
| 59 | MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in |
| 60 | DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_sfs-demo.dts.in |
| 61 | JSON_IN ${TS_ROOT}/environments/opteesp/sp_pkg.json.in |
| 62 | ) |