Soby Mathew | 73dad84 | 2022-12-16 12:51:01 +0000 | [diff] [blame] | 1 | # |
| 2 | # SPDX-License-Identifier: BSD-3-Clause |
| 3 | # SPDX-FileCopyrightText: Copyright TF-RMM Contributors. |
| 4 | # |
| 5 | |
Soby Mathew | 6f36516 | 2025-04-14 23:25:27 +0100 | [diff] [blame] | 6 | add_library(rmm-mbedtls INTERFACE) |
| 7 | |
Mate Toth-Pal | 83a45bd | 2023-09-01 11:17:19 +0200 | [diff] [blame] | 8 | # The Mbed TLS library is not included in the CBMC analysis |
| 9 | if(RMM_CBMC_STATIC_ANALYSIS) |
Mate Toth-Pal | 83a45bd | 2023-09-01 11:17:19 +0200 | [diff] [blame] | 10 | return() |
| 11 | endif() |
| 12 | |
Mate Toth-Pal | c69951d | 2023-03-17 17:30:50 +0100 | [diff] [blame] | 13 | set(MBEDTLS_SRC_DIR "${RMM_SOURCE_DIR}/ext/mbedtls") |
| 14 | |
Arunachalam Ganapathy | 188d9e6 | 2024-04-18 13:42:56 +0100 | [diff] [blame] | 15 | # Patch Mbed TLS before add_subdirectory() this allows to patch CMake files. |
Mate Toth-Pal | c69951d | 2023-03-17 17:30:50 +0100 | [diff] [blame] | 16 | # For details see commit messages in patch files. |
| 17 | set(MBEDTLS_PATCH_DIR "${RMM_SOURCE_DIR}/configs/mbedtls") |
| 18 | set(MBEDTLS_PATCH_FILES |
| 19 | "${MBEDTLS_PATCH_DIR}/0001-Remove-compiler-options-for-clang.patch" |
Mate Toth-Pal | 01b8fb2 | 2025-02-19 17:24:30 +0100 | [diff] [blame] | 20 | "${MBEDTLS_PATCH_DIR}/0002-Disable-explicit_bzero.patch" |
| 21 | "${MBEDTLS_PATCH_DIR}/0003-refactor-alloc-Use-the-heap-structure-provided-by-ap.patch") |
Arunachalam Ganapathy | 188d9e6 | 2024-04-18 13:42:56 +0100 | [diff] [blame] | 22 | |
Arunachalam Ganapathy | d9e8e1b | 2024-04-19 16:27:14 +0100 | [diff] [blame] | 23 | Git_Apply_Patches(${MBEDTLS_SRC_DIR} "${MBEDTLS_PATCH_FILES}") |