blob: f5589ff9aa84f93b3718634656b46e4dca3e47a5 [file] [log] [blame]
Julian Hall4834e632021-05-26 15:33:06 +01001#-------------------------------------------------------------------------------
Balint Dobszayff8e0cd2022-08-11 15:07:52 +02002# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
Julian Hall4834e632021-05-26 15:33:06 +01003#
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 Tothee2e7cb2024-10-07 17:02:56 +020014# Use libpsats for locating PSA services. An appropriate version of
15# libpsats will be imported for the environment.
Julian Hall4834e632021-05-26 15:33:06 +010016#-------------------------------------------------------------------------------
Gabor Toth76909ad2024-09-25 15:23:21 +020017if (COVERAGE)
Gabor Tothee2e7cb2024-10-07 17:02:56 +020018 set(LIBPSATS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libpsats build type" FORCE)
Gabor Toth76909ad2024-09-25 15:23:21 +020019 set(LIBTS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libts build type" FORCE)
20endif()
21
Gabor Tothee2e7cb2024-10-07 17:02:56 +020022include(${TS_ROOT}/deployments/libpsats/libpsats-import.cmake)
23target_link_libraries(platform-inspect PRIVATE libpsats::psats)
Julian Hall4834e632021-05-26 15:33:06 +010024
25#-------------------------------------------------------------------------------
Gyorgy Szingec62ea72022-07-20 12:36:52 +000026# Components that are common across all deployments
Julian Hall4834e632021-05-26 15:33:06 +010027#
28#-------------------------------------------------------------------------------
29add_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 Hall4834e632021-05-26 15:33:06 +010036 "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 Halla5443172022-05-30 11:52:11 +010045# MbedTLS provides libmbedcrypto
Gabor Toth4ad8b992024-08-13 10:41:48 +020046set(MBEDTLS_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/crypto_posix.h"
Julian Hall4834e632021-05-26 15:33:06 +010047 CACHE STRING "Configuration file for mbedcrypto")
Julian Halla5443172022-05-30 11:52:11 +010048include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
Balint Dobszayff8e0cd2022-08-11 15:07:52 +020049target_link_libraries(platform-inspect PRIVATE MbedTLS::mbedcrypto)
Julian Hall4834e632021-05-26 15:33:06 +010050
Balint Dobszayabec4642024-01-16 10:51:51 +010051# Use Mbed TLS to provide the psa crypto api interface files
52set(PSA_CRYPTO_API_INCLUDE "${MBEDTLS_PUBLIC_INCLUDE_PATH}")
53
Julian Hall4834e632021-05-26 15:33:06 +010054# Qcbor
55include(${TS_ROOT}/external/qcbor/qcbor.cmake)
Julian Hall4834e632021-05-26 15:33:06 +010056
57# t_cose
58include(${TS_ROOT}/external/t_cose/t_cose.cmake)
Gyorgy Szing52a832a2022-10-19 15:12:44 +020059# Ensure correct order of libraries on the command line of LD. t_cose depends on qcbor thus
60# qcbor must come later.
61target_link_libraries(platform-inspect PRIVATE t_cose qcbor)
Julian Hall4834e632021-05-26 15:33:06 +010062
63#-------------------------------------------------------------------------------
64# Define install content.
65#
66#-------------------------------------------------------------------------------
67if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
68 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
69endif()
70install(TARGETS platform-inspect RUNTIME DESTINATION ${TS_ENV}/bin)