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 | #------------------------------------------------------------------------------- |
| 14 | # Use libts for locating and accessing trusted services. An appropriate version |
Gyorgy Szing | ec62ea7 | 2022-07-20 12:36:52 +0000 | [diff] [blame] | 15 | # of libts will be imported for the environment in which platform-inspect is |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 16 | # built. |
| 17 | #------------------------------------------------------------------------------- |
| 18 | include(${TS_ROOT}/deployments/libts/libts-import.cmake) |
Gyorgy Szing | ec62ea7 | 2022-07-20 12:36:52 +0000 | [diff] [blame] | 19 | target_link_libraries(platform-inspect PRIVATE libts::ts) |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 20 | |
| 21 | #------------------------------------------------------------------------------- |
Gyorgy Szing | ec62ea7 | 2022-07-20 12:36:52 +0000 | [diff] [blame] | 22 | # Components that are common across all deployments |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 23 | # |
| 24 | #------------------------------------------------------------------------------- |
| 25 | add_components( |
| 26 | TARGET "platform-inspect" |
| 27 | BASE_DIR ${TS_ROOT} |
| 28 | COMPONENTS |
| 29 | "components/app/platform-inspect" |
| 30 | "components/common/tlv" |
| 31 | "components/common/cbor_dump" |
Julian Hall | 99a57e3 | 2021-07-28 14:18:50 +0100 | [diff] [blame] | 32 | "components/service/common/client" |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 33 | "components/service/common/include" |
| 34 | "components/service/attestation/include" |
| 35 | "components/service/attestation/client/psa" |
| 36 | "components/service/attestation/client/provision" |
| 37 | "components/service/attestation/reporter/dump/raw" |
| 38 | "components/service/attestation/reporter/dump/pretty" |
| 39 | ) |
| 40 | |
| 41 | #------------------------------------------------------------------------------- |
| 42 | # Components used from external projects |
| 43 | # |
| 44 | #------------------------------------------------------------------------------- |
| 45 | |
Julian Hall | a544317 | 2022-05-30 11:52:11 +0100 | [diff] [blame] | 46 | # MbedTLS provides libmbedcrypto |
| 47 | set(MBEDTLS_USER_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/crypto_posix.h" |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 48 | CACHE STRING "Configuration file for mbedcrypto") |
Julian Hall | a544317 | 2022-05-30 11:52:11 +0100 | [diff] [blame] | 49 | include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake) |
Balint Dobszay | ff8e0cd | 2022-08-11 15:07:52 +0200 | [diff] [blame] | 50 | target_link_libraries(platform-inspect PRIVATE MbedTLS::mbedcrypto) |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 51 | |
Balint Dobszay | abec464 | 2024-01-16 10:51:51 +0100 | [diff] [blame] | 52 | # Use Mbed TLS to provide the psa crypto api interface files |
| 53 | set(PSA_CRYPTO_API_INCLUDE "${MBEDTLS_PUBLIC_INCLUDE_PATH}") |
| 54 | |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 55 | # Qcbor |
| 56 | include(${TS_ROOT}/external/qcbor/qcbor.cmake) |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 57 | |
| 58 | # t_cose |
| 59 | include(${TS_ROOT}/external/t_cose/t_cose.cmake) |
Gyorgy Szing | 52a832a | 2022-10-19 15:12:44 +0200 | [diff] [blame] | 60 | # Ensure correct order of libraries on the command line of LD. t_cose depends on qcbor thus |
| 61 | # qcbor must come later. |
| 62 | target_link_libraries(platform-inspect PRIVATE t_cose qcbor) |
Julian Hall | 4834e63 | 2021-05-26 15:33:06 +0100 | [diff] [blame] | 63 | |
| 64 | #------------------------------------------------------------------------------- |
| 65 | # Define install content. |
| 66 | # |
| 67 | #------------------------------------------------------------------------------- |
| 68 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 69 | set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE) |
| 70 | endif() |
| 71 | install(TARGETS platform-inspect RUNTIME DESTINATION ${TS_ENV}/bin) |