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 | |
| 6 | add_library(t_cose) |
| 7 | |
| 8 | set(T_COSE_SOURCE_DIR "${RMM_SOURCE_DIR}/ext/t_cose") |
| 9 | |
Mate Toth-Pal | fda673a | 2023-06-13 12:25:43 +0200 | [diff] [blame^] | 10 | #TODO: Eliminate warning suppression once the t_cose submodule is updated to |
| 11 | # a released version. |
| 12 | target_compile_options(t_cose |
| 13 | PRIVATE |
| 14 | "-Wno-maybe-uninitialized" |
| 15 | "-Wno-cpp" |
| 16 | "-Wno-unused-variable") |
| 17 | |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 18 | target_compile_definitions(t_cose |
Mate Toth-Pal | c69951d | 2023-03-17 17:30:50 +0100 | [diff] [blame] | 19 | PRIVATE |
| 20 | "T_COSE_USE_PSA_CRYPTO=1" |
| 21 | "T_COSE_DISABLE_HPKE=1" |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 22 | ) |
| 23 | |
| 24 | target_link_libraries(t_cose |
| 25 | PRIVATE |
| 26 | rmm-lib-common |
| 27 | rmm-lib-libc |
| 28 | ) |
| 29 | |
| 30 | target_link_libraries(t_cose |
| 31 | PUBLIC |
Soby Mathew | 73dad84 | 2022-12-16 12:51:01 +0000 | [diff] [blame] | 32 | rmm-mbedtls |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 33 | qcbor |
| 34 | ) |
| 35 | |
| 36 | target_include_directories(t_cose |
| 37 | PUBLIC |
| 38 | "${T_COSE_SOURCE_DIR}/inc" |
Mate Toth-Pal | c69951d | 2023-03-17 17:30:50 +0100 | [diff] [blame] | 39 | "${T_COSE_SOURCE_DIR}/crypto_adapters" |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 40 | PRIVATE |
| 41 | "${T_COSE_SOURCE_DIR}/src" |
| 42 | ) |
| 43 | |
| 44 | target_sources(t_cose |
| 45 | PRIVATE |
Soby Mathew | 4d4c21a | 2023-06-29 14:52:41 +0200 | [diff] [blame] | 46 | "${T_COSE_SOURCE_DIR}/crypto_adapters/t_cose_psa_crypto.c" |
Mate Toth-Pal | fda673a | 2023-06-13 12:25:43 +0200 | [diff] [blame^] | 47 | "${T_COSE_SOURCE_DIR}/src/t_cose_parameters.c" |
| 48 | "${T_COSE_SOURCE_DIR}/src/t_cose_sign_sign.c" |
| 49 | "${T_COSE_SOURCE_DIR}/src/t_cose_signature_sign_restart.c" |
| 50 | "${T_COSE_SOURCE_DIR}/src/t_cose_util.c" |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 51 | ) |