blob: 929036779f3a7f847afb43af1f083e1db65d5c4a [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 Toth3460b422023-07-17 10:29:24 +020014# Use libpsa for locating PSA services. An appropriate version of
15# libpsa will be imported for the environment.
Julian Hall4834e632021-05-26 15:33:06 +010016#-------------------------------------------------------------------------------
Gabor Toth3460b422023-07-17 10:29:24 +020017include(${TS_ROOT}/deployments/libpsa/libpsa-import.cmake)
18target_link_libraries(platform-inspect PRIVATE libpsa::psa)
Julian Hall4834e632021-05-26 15:33:06 +010019
20#-------------------------------------------------------------------------------
Gyorgy Szingec62ea72022-07-20 12:36:52 +000021# Components that are common across all deployments
Julian Hall4834e632021-05-26 15:33:06 +010022#
23#-------------------------------------------------------------------------------
24add_components(
25 TARGET "platform-inspect"
26 BASE_DIR ${TS_ROOT}
27 COMPONENTS
28 "components/app/platform-inspect"
29 "components/common/tlv"
30 "components/common/cbor_dump"
Julian Hall4834e632021-05-26 15:33:06 +010031 "components/service/attestation/reporter/dump/raw"
32 "components/service/attestation/reporter/dump/pretty"
33)
34
35#-------------------------------------------------------------------------------
36# Components used from external projects
37#
38#-------------------------------------------------------------------------------
39
Julian Halla5443172022-05-30 11:52:11 +010040# MbedTLS provides libmbedcrypto
41set(MBEDTLS_USER_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/crypto_posix.h"
Julian Hall4834e632021-05-26 15:33:06 +010042 CACHE STRING "Configuration file for mbedcrypto")
Julian Halla5443172022-05-30 11:52:11 +010043include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
Balint Dobszayff8e0cd2022-08-11 15:07:52 +020044target_link_libraries(platform-inspect PRIVATE MbedTLS::mbedcrypto)
Julian Hall4834e632021-05-26 15:33:06 +010045
Balint Dobszayabec4642024-01-16 10:51:51 +010046# Use Mbed TLS to provide the psa crypto api interface files
47set(PSA_CRYPTO_API_INCLUDE "${MBEDTLS_PUBLIC_INCLUDE_PATH}")
48
Julian Hall4834e632021-05-26 15:33:06 +010049# Qcbor
50include(${TS_ROOT}/external/qcbor/qcbor.cmake)
Julian Hall4834e632021-05-26 15:33:06 +010051
52# t_cose
53include(${TS_ROOT}/external/t_cose/t_cose.cmake)
Gyorgy Szing52a832a2022-10-19 15:12:44 +020054# Ensure correct order of libraries on the command line of LD. t_cose depends on qcbor thus
55# qcbor must come later.
56target_link_libraries(platform-inspect PRIVATE t_cose qcbor)
Julian Hall4834e632021-05-26 15:33:06 +010057
58#-------------------------------------------------------------------------------
59# Define install content.
60#
61#-------------------------------------------------------------------------------
62if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
63 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
64endif()
65install(TARGETS platform-inspect RUNTIME DESTINATION ${TS_ENV}/bin)