blob: 847154b8dbce713ca737c9b5e31c92cb31d73f09 [file] [log] [blame]
Soby Mathew73dad842022-12-16 12:51:01 +00001#
2# SPDX-License-Identifier: BSD-3-Clause
3# SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
4#
5
Soby Mathew6f365162025-04-14 23:25:27 +01006add_library(rmm-mbedtls INTERFACE)
7
Mate Toth-Pal83a45bd2023-09-01 11:17:19 +02008# The Mbed TLS library is not included in the CBMC analysis
9if(RMM_CBMC_STATIC_ANALYSIS)
Mate Toth-Pal83a45bd2023-09-01 11:17:19 +020010 return()
11endif()
12
Mate Toth-Palc69951d2023-03-17 17:30:50 +010013set(MBEDTLS_SRC_DIR "${RMM_SOURCE_DIR}/ext/mbedtls")
14
Arunachalam Ganapathy188d9e62024-04-18 13:42:56 +010015# Patch Mbed TLS before add_subdirectory() this allows to patch CMake files.
Mate Toth-Palc69951d2023-03-17 17:30:50 +010016# For details see commit messages in patch files.
17set(MBEDTLS_PATCH_DIR "${RMM_SOURCE_DIR}/configs/mbedtls")
18set(MBEDTLS_PATCH_FILES
19 "${MBEDTLS_PATCH_DIR}/0001-Remove-compiler-options-for-clang.patch"
Mate Toth-Pal01b8fb22025-02-19 17:24:30 +010020 "${MBEDTLS_PATCH_DIR}/0002-Disable-explicit_bzero.patch"
21 "${MBEDTLS_PATCH_DIR}/0003-refactor-alloc-Use-the-heap-structure-provided-by-ap.patch")
Arunachalam Ganapathy188d9e62024-04-18 13:42:56 +010022
Arunachalam Ganapathyd9e8e1b2024-04-19 16:27:14 +010023Git_Apply_Patches(${MBEDTLS_SRC_DIR} "${MBEDTLS_PATCH_FILES}")