Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 1 | # |
| 2 | # SPDX-License-Identifier: BSD-3-Clause |
| 3 | # SPDX-FileCopyrightText: Copyright TF-RMM Contributors. |
| 4 | # |
| 5 | |
Mate Toth-Pal | 83a45bd | 2023-09-01 11:17:19 +0200 | [diff] [blame] | 6 | # The t_cose library is not included in the CBMC analysis |
| 7 | if(RMM_CBMC_STATIC_ANALYSIS) |
| 8 | add_library(t_cose INTERFACE) |
| 9 | return() |
| 10 | endif() |
| 11 | |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 12 | add_library(t_cose) |
| 13 | |
| 14 | set(T_COSE_SOURCE_DIR "${RMM_SOURCE_DIR}/ext/t_cose") |
| 15 | |
Mate Toth-Pal | fda673a | 2023-06-13 12:25:43 +0200 | [diff] [blame] | 16 | #TODO: Eliminate warning suppression once the t_cose submodule is updated to |
| 17 | # a released version. |
| 18 | target_compile_options(t_cose |
| 19 | PRIVATE |
| 20 | "-Wno-maybe-uninitialized" |
| 21 | "-Wno-cpp" |
| 22 | "-Wno-unused-variable") |
| 23 | |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 24 | target_compile_definitions(t_cose |
Mate Toth-Pal | c69951d | 2023-03-17 17:30:50 +0100 | [diff] [blame] | 25 | PRIVATE |
| 26 | "T_COSE_USE_PSA_CRYPTO=1" |
| 27 | "T_COSE_DISABLE_HPKE=1" |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 28 | ) |
| 29 | |
| 30 | target_link_libraries(t_cose |
| 31 | PRIVATE |
| 32 | rmm-lib-common |
| 33 | rmm-lib-libc |
| 34 | ) |
| 35 | |
| 36 | target_link_libraries(t_cose |
| 37 | PUBLIC |
Soby Mathew | 73dad84 | 2022-12-16 12:51:01 +0000 | [diff] [blame] | 38 | rmm-mbedtls |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 39 | qcbor |
| 40 | ) |
| 41 | |
| 42 | target_include_directories(t_cose |
| 43 | PUBLIC |
| 44 | "${T_COSE_SOURCE_DIR}/inc" |
Mate Toth-Pal | c69951d | 2023-03-17 17:30:50 +0100 | [diff] [blame] | 45 | "${T_COSE_SOURCE_DIR}/crypto_adapters" |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 46 | PRIVATE |
| 47 | "${T_COSE_SOURCE_DIR}/src" |
| 48 | ) |
| 49 | |
| 50 | target_sources(t_cose |
| 51 | PRIVATE |
Soby Mathew | 4d4c21a | 2023-06-29 14:52:41 +0200 | [diff] [blame] | 52 | "${T_COSE_SOURCE_DIR}/crypto_adapters/t_cose_psa_crypto.c" |
Mate Toth-Pal | fda673a | 2023-06-13 12:25:43 +0200 | [diff] [blame] | 53 | "${T_COSE_SOURCE_DIR}/src/t_cose_parameters.c" |
| 54 | "${T_COSE_SOURCE_DIR}/src/t_cose_sign_sign.c" |
| 55 | "${T_COSE_SOURCE_DIR}/src/t_cose_signature_sign_restart.c" |
| 56 | "${T_COSE_SOURCE_DIR}/src/t_cose_util.c" |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 57 | ) |