Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Balint Dobszay | ff8e0cd | 2022-08-11 15:07:52 +0200 | [diff] [blame] | 2 | # Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved. |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | #------------------------------------------------------------------------------- |
| 9 | # The base build file shared between deployments of 'platform-inspect' for |
| 10 | # different environments. |
| 11 | #------------------------------------------------------------------------------- |
| 12 | |
| 13 | #------------------------------------------------------------------------------- |
Gabor Toth | ee2e7cb | 2024-10-07 17:02:56 +0200 | [diff] [blame] | 14 | # Use libpsats for locating PSA services. An appropriate version of |
| 15 | # libpsats will be imported for the environment. |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 16 | #------------------------------------------------------------------------------- |
Gabor Toth | 76909ad | 2024-09-25 15:23:21 +0200 | [diff] [blame] | 17 | if (COVERAGE) |
Gabor Toth | ee2e7cb | 2024-10-07 17:02:56 +0200 | [diff] [blame] | 18 | set(LIBPSATS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libpsats build type" FORCE) |
Gabor Toth | 76909ad | 2024-09-25 15:23:21 +0200 | [diff] [blame] | 19 | set(LIBTS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libts build type" FORCE) |
| 20 | endif() |
| 21 | |
Gabor Toth | ee2e7cb | 2024-10-07 17:02:56 +0200 | [diff] [blame] | 22 | include(${TS_ROOT}/deployments/libpsats/libpsats-import.cmake) |
| 23 | target_link_libraries(platform-inspect PRIVATE libpsats::psats) |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 24 | |
| 25 | #------------------------------------------------------------------------------- |
Gyorgy Szing | ec62ea7 | 2022-07-20 12:36:52 +0000 | [diff] [blame] | 26 | # Components that are common across all deployments |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 27 | # |
| 28 | #------------------------------------------------------------------------------- |
| 29 | add_components( |
| 30 | TARGET "platform-inspect" |
| 31 | BASE_DIR ${TS_ROOT} |
| 32 | COMPONENTS |
| 33 | "components/app/platform-inspect" |
| 34 | "components/common/tlv" |
| 35 | "components/common/cbor_dump" |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 36 | "components/service/attestation/reporter/dump/raw" |
| 37 | "components/service/attestation/reporter/dump/pretty" |
| 38 | ) |
| 39 | |
| 40 | #------------------------------------------------------------------------------- |
| 41 | # Components used from external projects |
| 42 | # |
| 43 | #------------------------------------------------------------------------------- |
| 44 | |
Julian Hall | a544317 | 2022-05-30 11:52:11 +0100 | [diff] [blame] | 45 | # MbedTLS provides libmbedcrypto |
Gabor Toth | 4ad8b99 | 2024-08-13 10:41:48 +0200 | [diff] [blame] | 46 | set(MBEDTLS_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/crypto_posix.h" |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 47 | CACHE STRING "Configuration file for mbedcrypto") |
Julian Hall | a544317 | 2022-05-30 11:52:11 +0100 | [diff] [blame] | 48 | include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake) |
Balint Dobszay | ff8e0cd | 2022-08-11 15:07:52 +0200 | [diff] [blame] | 49 | target_link_libraries(platform-inspect PRIVATE MbedTLS::mbedcrypto) |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 50 | |
Balint Dobszay | abec464 | 2024-01-16 10:51:51 +0100 | [diff] [blame] | 51 | # Use Mbed TLS to provide the psa crypto api interface files |
| 52 | set(PSA_CRYPTO_API_INCLUDE "${MBEDTLS_PUBLIC_INCLUDE_PATH}") |
| 53 | |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 54 | # Qcbor |
| 55 | include(${TS_ROOT}/external/qcbor/qcbor.cmake) |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 56 | |
| 57 | # t_cose |
| 58 | include(${TS_ROOT}/external/t_cose/t_cose.cmake) |
Gyorgy Szing | 52a832a | 2022-10-19 15:12:44 +0200 | [diff] [blame] | 59 | # Ensure correct order of libraries on the command line of LD. t_cose depends on qcbor thus |
| 60 | # qcbor must come later. |
| 61 | target_link_libraries(platform-inspect PRIVATE t_cose qcbor) |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 62 | |
| 63 | #------------------------------------------------------------------------------- |
| 64 | # Define install content. |
| 65 | # |
| 66 | #------------------------------------------------------------------------------- |
| 67 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 68 | set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE) |
| 69 | endif() |
| 70 | install(TARGETS platform-inspect RUNTIME DESTINATION ${TS_ENV}/bin) |