Tamas Ban | c2e0c18 | 2020-01-07 15:09:16 +0000 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Jamie Fox | 10f0870 | 2024-06-21 14:21:34 +0100 | [diff] [blame] | 2 | # Copyright (c) 2020-2024, Arm Limited. All rights reserved. |
Tamas Ban | c2e0c18 | 2020-01-07 15:09:16 +0000 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
David Hu | 1249f0d | 2023-12-04 22:57:56 +0800 | [diff] [blame] | 8 | cmake_minimum_required(VERSION 3.21) |
Tamas Ban | c2e0c18 | 2020-01-07 15:09:16 +0000 | [diff] [blame] | 9 | |
Adam Kulesza | 4ced6b3 | 2022-05-24 19:13:56 +0200 | [diff] [blame^] | 10 | |
| 11 | include(FetchContent) |
| 12 | set(FETCHCONTENT_QUIET FALSE) |
| 13 | |
| 14 | # Default configuration of T_COSE repository |
| 15 | set(T_COSE_PATH "DOWNLOAD" CACHE PATH "Path to t_cose (or DOWNLOAD to fetch automatically") |
| 16 | set(T_COSE_VERSION "v2.0-alpha-2" CACHE STRING "The version of t_cose to use") |
| 17 | |
| 18 | fetch_remote_library( |
| 19 | LIB_NAME t_cose |
| 20 | LIB_SOURCE_PATH_VAR T_COSE_PATH |
| 21 | LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR} |
| 22 | LIB_BASE_DIR "${CMAKE_BINARY_DIR}/lib/ext" |
| 23 | FETCH_CONTENT_ARGS |
| 24 | GIT_REPOSITORY https://github.com/laurencelundblade/t_cose.git |
| 25 | GIT_TAG ${T_COSE_VERSION} |
| 26 | GIT_SHALLOW TRUE |
| 27 | GIT_PROGRESS TRUE |
| 28 | ) |
| 29 | |
Kevin Peng | 2f4ef24 | 2023-09-11 09:35:51 +0800 | [diff] [blame] | 30 | include(${CMAKE_CURRENT_LIST_DIR}/tfm_t_cose.cmake) |
Antonio de Angelis | 34a0ffd | 2023-02-16 11:56:46 +0000 | [diff] [blame] | 31 | |
shejia01 | d853fe8 | 2021-07-12 20:03:55 +0800 | [diff] [blame] | 32 | ############################ t_cose secure ##################################### |
| 33 | |
| 34 | add_library(tfm_t_cose_s STATIC EXCLUDE_FROM_ALL) |
| 35 | |
| 36 | target_link_libraries(tfm_t_cose_s |
| 37 | PUBLIC |
shejia01 | d853fe8 | 2021-07-12 20:03:55 +0800 | [diff] [blame] | 38 | tfm_t_cose_defs |
Jamie Fox | 10f0870 | 2024-06-21 14:21:34 +0100 | [diff] [blame] | 39 | PRIVATE |
| 40 | tfm_t_cose_common |
shejia01 | d853fe8 | 2021-07-12 20:03:55 +0800 | [diff] [blame] | 41 | psa_interface |
David Vincze | 3de4228 | 2022-11-10 16:26:45 +0100 | [diff] [blame] | 42 | qcbor |
Antonio de Angelis | 8bb9851 | 2024-01-16 14:13:36 +0000 | [diff] [blame] | 43 | platform_s |
shejia01 | d853fe8 | 2021-07-12 20:03:55 +0800 | [diff] [blame] | 44 | ) |
| 45 | |
Feder Liang | d4dbaa9 | 2021-09-07 15:34:46 +0800 | [diff] [blame] | 46 | target_compile_options(tfm_t_cose_s |
Jamie Fox | 10f0870 | 2024-06-21 14:21:34 +0100 | [diff] [blame] | 47 | PRIVATE |
Feder Liang | d4dbaa9 | 2021-09-07 15:34:46 +0800 | [diff] [blame] | 48 | ${COMPILER_CP_FLAG} |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 49 | ) |