blob: 562d9d1e0e5f320bf750ee3fdf54045d6b827501 [file] [log] [blame]
Imre Kisd0ed5c22021-12-15 17:05:47 +01001#-------------------------------------------------------------------------------
Gabor Toth75951632023-09-06 09:17:28 +02002# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
Imre Kisd0ed5c22021-12-15 17:05:47 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
Gabor Tothbdc11a72023-12-13 09:02:15 +01008option(UEFI_INTERNAL_CRYPTO "Use internal mbedtls instance" OFF)
9
10if (UEFI_AUTH_VAR)
11
12# If enabled an internal mbedtls instance will be used instead of the crypto SP
13if (UEFI_INTERNAL_CRYPTO)
14set(MBEDTLS_USER_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/x509_only.h"
15 CACHE STRING "Configuration file for Mbed TLS" FORCE)
16include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
17target_link_libraries(smm-gateway PRIVATE MbedTLS::mbedcrypto)
18target_link_libraries(smm-gateway PRIVATE MbedTLS::mbedx509)
19
Gabor Tothaf77b472024-04-05 11:19:37 +020020# Pass the mbedtls config file to C preprocessor so the uefi
21# direct backend will access the mbedtls headers
22target_compile_definitions(smm-gateway PRIVATE
23 MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}"
24)
25
Gabor Tothbdc11a72023-12-13 09:02:15 +010026target_compile_definitions(smm-gateway PRIVATE
27 -DUEFI_INTERNAL_CRYPTO
28)
29
30add_components(TARGET "smm-gateway"
31 BASE_DIR ${TS_ROOT}
32 COMPONENTS
Gabor Tothaf77b472024-04-05 11:19:37 +020033 "components/common/mbedtls"
Gabor Tothbdc11a72023-12-13 09:02:15 +010034 "components/service/uefi/smm_variable/backend/direct"
35)
36
37else()
38add_components(TARGET "smm-gateway"
39 BASE_DIR ${TS_ROOT}
40 COMPONENTS
41 "components/common/tlv"
42 "components/service/crypto/include"
43 "components/service/crypto/client/psa"
44)
45endif()
46
47endif()
48
Imre Kisd0ed5c22021-12-15 17:05:47 +010049add_components(TARGET "smm-gateway"
50 BASE_DIR ${TS_ROOT}
51 COMPONENTS
Julian Hall29620bf2022-06-09 10:26:37 +010052 "components/common/trace"
53 "components/common/utils"
Imre Kisd0ed5c22021-12-15 17:05:47 +010054 "components/common/uuid"
Imre Kisd0ed5c22021-12-15 17:05:47 +010055 "components/rpc/common/interface"
56 "components/service/common/include"
Imre Kisd0ed5c22021-12-15 17:05:47 +010057 "components/service/common/provider"
Julian Hall98656d52022-05-05 11:09:21 +010058 "components/service/uefi/smm_variable/backend"
59 "components/service/uefi/smm_variable/provider"
Imre Kisd0ed5c22021-12-15 17:05:47 +010060 "components/service/secure_storage/include"
Imre Kisd0ed5c22021-12-15 17:05:47 +010061 "components/service/secure_storage/backend/mock_store"
62 "protocols/rpc/common/packed-c"
Imre Kisd0ed5c22021-12-15 17:05:47 +010063)
64
Imre Kisd0ed5c22021-12-15 17:05:47 +010065target_include_directories(smm-gateway PRIVATE
66 ${TS_ROOT}
67 ${TS_ROOT}/components
68)