blob: aa3c5230a73c6800eb3723929de681ce3e4e67ab [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#-------------------------------------------------------------------------------
14# Use libts for locating and accessing trusted services. An appropriate version
Gyorgy Szingec62ea72022-07-20 12:36:52 +000015# of libts will be imported for the environment in which platform-inspect is
Julian Hall4834e632021-05-26 15:33:06 +010016# built.
17#-------------------------------------------------------------------------------
18include(${TS_ROOT}/deployments/libts/libts-import.cmake)
Gyorgy Szingec62ea72022-07-20 12:36:52 +000019target_link_libraries(platform-inspect PRIVATE libts::ts)
Julian Hall4834e632021-05-26 15:33:06 +010020
21#-------------------------------------------------------------------------------
Gyorgy Szingec62ea72022-07-20 12:36:52 +000022# Components that are common across all deployments
Julian Hall4834e632021-05-26 15:33:06 +010023#
24#-------------------------------------------------------------------------------
25add_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 Hall99a57e32021-07-28 14:18:50 +010032 "components/service/common/client"
Julian Hall4834e632021-05-26 15:33:06 +010033 "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 Halla5443172022-05-30 11:52:11 +010046# MbedTLS provides libmbedcrypto
47set(MBEDTLS_USER_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/crypto_posix.h"
Julian Hall4834e632021-05-26 15:33:06 +010048 CACHE STRING "Configuration file for mbedcrypto")
Julian Halla5443172022-05-30 11:52:11 +010049include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
Balint Dobszayff8e0cd2022-08-11 15:07:52 +020050target_link_libraries(platform-inspect PRIVATE MbedTLS::mbedcrypto)
Julian Hall4834e632021-05-26 15:33:06 +010051
Balint Dobszayabec4642024-01-16 10:51:51 +010052# Use Mbed TLS to provide the psa crypto api interface files
53set(PSA_CRYPTO_API_INCLUDE "${MBEDTLS_PUBLIC_INCLUDE_PATH}")
54
Julian Hall4834e632021-05-26 15:33:06 +010055# Qcbor
56include(${TS_ROOT}/external/qcbor/qcbor.cmake)
Julian Hall4834e632021-05-26 15:33:06 +010057
58# t_cose
59include(${TS_ROOT}/external/t_cose/t_cose.cmake)
Gyorgy Szing52a832a2022-10-19 15:12:44 +020060# Ensure correct order of libraries on the command line of LD. t_cose depends on qcbor thus
61# qcbor must come later.
62target_link_libraries(platform-inspect PRIVATE t_cose qcbor)
Julian Hall4834e632021-05-26 15:33:06 +010063
64#-------------------------------------------------------------------------------
65# Define install content.
66#
67#-------------------------------------------------------------------------------
68if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
69 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
70endif()
71install(TARGETS platform-inspect RUNTIME DESTINATION ${TS_ENV}/bin)