blob: 290eff7b5e20da70783cb3a7e2cb26153cefb69d [file] [log] [blame]
Tamas Banc2e0c182020-01-07 15:09:16 +00001#-------------------------------------------------------------------------------
Jamie Fox10f08702024-06-21 14:21:34 +01002# Copyright (c) 2020-2024, Arm Limited. All rights reserved.
Tamas Banc2e0c182020-01-07 15:09:16 +00003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
David Hu1249f0d2023-12-04 22:57:56 +08008cmake_minimum_required(VERSION 3.21)
Tamas Banc2e0c182020-01-07 15:09:16 +00009
Adam Kulesza4ced6b32022-05-24 19:13:56 +020010
11include(FetchContent)
12set(FETCHCONTENT_QUIET FALSE)
13
14# Default configuration of T_COSE repository
15set(T_COSE_PATH "DOWNLOAD" CACHE PATH "Path to t_cose (or DOWNLOAD to fetch automatically")
16set(T_COSE_VERSION "v2.0-alpha-2" CACHE STRING "The version of t_cose to use")
17
18fetch_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 Peng2f4ef242023-09-11 09:35:51 +080030include(${CMAKE_CURRENT_LIST_DIR}/tfm_t_cose.cmake)
Antonio de Angelis34a0ffd2023-02-16 11:56:46 +000031
shejia01d853fe82021-07-12 20:03:55 +080032############################ t_cose secure #####################################
33
34add_library(tfm_t_cose_s STATIC EXCLUDE_FROM_ALL)
35
36target_link_libraries(tfm_t_cose_s
37 PUBLIC
shejia01d853fe82021-07-12 20:03:55 +080038 tfm_t_cose_defs
Jamie Fox10f08702024-06-21 14:21:34 +010039 PRIVATE
40 tfm_t_cose_common
shejia01d853fe82021-07-12 20:03:55 +080041 psa_interface
David Vincze3de42282022-11-10 16:26:45 +010042 qcbor
Antonio de Angelis8bb98512024-01-16 14:13:36 +000043 platform_s
shejia01d853fe82021-07-12 20:03:55 +080044)
45
Feder Liangd4dbaa92021-09-07 15:34:46 +080046target_compile_options(tfm_t_cose_s
Jamie Fox10f08702024-06-21 14:21:34 +010047 PRIVATE
Feder Liangd4dbaa92021-09-07 15:34:46 +080048 ${COMPILER_CP_FLAG}
Raef Coles19715382020-07-10 09:50:17 +010049)