Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Gabor Toth | 7595163 | 2023-09-06 09:17:28 +0200 | [diff] [blame] | 2 | # Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved. |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
Gabor Toth | bdc11a7 | 2023-12-13 09:02:15 +0100 | [diff] [blame] | 8 | option(UEFI_INTERNAL_CRYPTO "Use internal mbedtls instance" OFF) |
| 9 | |
| 10 | if (UEFI_AUTH_VAR) |
| 11 | |
| 12 | # If enabled an internal mbedtls instance will be used instead of the crypto SP |
| 13 | if (UEFI_INTERNAL_CRYPTO) |
Gabor Toth | 4ad8b99 | 2024-08-13 10:41:48 +0200 | [diff] [blame] | 14 | set(MBEDTLS_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/internal_crypto_smmgw.h" |
Gabor Toth | bdc11a7 | 2023-12-13 09:02:15 +0100 | [diff] [blame] | 15 | CACHE STRING "Configuration file for Mbed TLS" FORCE) |
| 16 | include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake) |
| 17 | target_link_libraries(smm-gateway PRIVATE MbedTLS::mbedcrypto) |
| 18 | target_link_libraries(smm-gateway PRIVATE MbedTLS::mbedx509) |
| 19 | |
Gabor Toth | af77b47 | 2024-04-05 11:19:37 +0200 | [diff] [blame] | 20 | # Pass the mbedtls config file to C preprocessor so the uefi |
| 21 | # direct backend will access the mbedtls headers |
| 22 | target_compile_definitions(smm-gateway PRIVATE |
Gabor Toth | 4ad8b99 | 2024-08-13 10:41:48 +0200 | [diff] [blame] | 23 | MBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}" |
Gabor Toth | af77b47 | 2024-04-05 11:19:37 +0200 | [diff] [blame] | 24 | ) |
| 25 | |
Gabor Toth | bdc11a7 | 2023-12-13 09:02:15 +0100 | [diff] [blame] | 26 | target_compile_definitions(smm-gateway PRIVATE |
| 27 | -DUEFI_INTERNAL_CRYPTO |
| 28 | ) |
| 29 | |
| 30 | add_components(TARGET "smm-gateway" |
| 31 | BASE_DIR ${TS_ROOT} |
| 32 | COMPONENTS |
Gabor Toth | af77b47 | 2024-04-05 11:19:37 +0200 | [diff] [blame] | 33 | "components/common/mbedtls" |
Gabor Toth | bdc11a7 | 2023-12-13 09:02:15 +0100 | [diff] [blame] | 34 | "components/service/uefi/smm_variable/backend/direct" |
Gabor Toth | 4ad8b99 | 2024-08-13 10:41:48 +0200 | [diff] [blame] | 35 | "components/service/crypto/backend/mbedcrypto/trng_adapter/stub" |
Gabor Toth | bdc11a7 | 2023-12-13 09:02:15 +0100 | [diff] [blame] | 36 | ) |
| 37 | |
| 38 | else() |
| 39 | add_components(TARGET "smm-gateway" |
| 40 | BASE_DIR ${TS_ROOT} |
| 41 | COMPONENTS |
| 42 | "components/common/tlv" |
| 43 | "components/service/crypto/include" |
| 44 | "components/service/crypto/client/psa" |
| 45 | ) |
| 46 | endif() |
| 47 | |
| 48 | endif() |
| 49 | |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 50 | add_components(TARGET "smm-gateway" |
| 51 | BASE_DIR ${TS_ROOT} |
| 52 | COMPONENTS |
Julian Hall | 29620bf | 2022-06-09 10:26:37 +0100 | [diff] [blame] | 53 | "components/common/trace" |
| 54 | "components/common/utils" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 55 | "components/common/uuid" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 56 | "components/rpc/common/interface" |
| 57 | "components/service/common/include" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 58 | "components/service/common/provider" |
Julian Hall | 98656d5 | 2022-05-05 11:09:21 +0100 | [diff] [blame] | 59 | "components/service/uefi/smm_variable/backend" |
| 60 | "components/service/uefi/smm_variable/provider" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 61 | "components/service/secure_storage/include" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 62 | "components/service/secure_storage/backend/mock_store" |
| 63 | "protocols/rpc/common/packed-c" |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 64 | ) |
| 65 | |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 66 | target_include_directories(smm-gateway PRIVATE |
| 67 | ${TS_ROOT} |
| 68 | ${TS_ROOT}/components |
| 69 | ) |