Kevin Peng | aa32cdf | 2023-09-11 10:38:22 +0800 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2020-2023, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
David Hu | 4c3c0ca | 2023-12-02 22:09:18 +0800 | [diff] [blame] | 8 | cmake_minimum_required(VERSION 3.21) |
Kevin Peng | aa32cdf | 2023-09-11 10:38:22 +0800 | [diff] [blame] | 9 | |
Bohdan Hunko | 91b6dea | 2024-02-28 22:55:42 +0200 | [diff] [blame] | 10 | if(NOT TEST_NS_ATTESTATION AND NOT TEST_NS_QCBOR AND NOT TEST_NS_T_COSE) |
Kevin Peng | aa32cdf | 2023-09-11 10:38:22 +0800 | [diff] [blame] | 11 | return() |
| 12 | endif() |
| 13 | |
| 14 | include(FetchContent) |
| 15 | set(FETCHCONTENT_QUIET FALSE) |
| 16 | |
| 17 | # Default configuration of QCBOR repository |
| 18 | set(QCBOR_PATH "DOWNLOAD" CACHE PATH "Path to qcbor (or DOWNLOAD to fetch automatically") |
| 19 | set(QCBOR_VERSION "v1.2" CACHE STRING "The version of qcbor to use") |
| 20 | |
| 21 | # Entirely disable the floating-point support |
| 22 | # in the qcbor library to reduce code size. |
| 23 | set(QCBOR_OPT_DISABLE_FLOAT_HW_USE ON CACHE BOOL "Eliminate dependency on FP hardware and FP instructions" FORCE) |
| 24 | set(QCBOR_OPT_DISABLE_FLOAT_PREFERRED ON CACHE BOOL "Eliminate support for half-precision and CBOR preferred serialization" FORCE) |
| 25 | set(QCBOR_OPT_DISABLE_FLOAT_ALL ON CACHE BOOL "Eliminate floating-point support completely" FORCE) |
| 26 | |
| 27 | fetch_remote_library( |
| 28 | LIB_NAME qcbor |
| 29 | LIB_SOURCE_PATH_VAR QCBOR_PATH |
| 30 | LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR} |
| 31 | LIB_BASE_DIR "${CMAKE_BINARY_DIR}/lib/ext" |
| 32 | FETCH_CONTENT_ARGS |
| 33 | GIT_REPOSITORY https://github.com/laurencelundblade/QCBOR.git |
| 34 | GIT_TAG ${QCBOR_VERSION} |
Jamie Fox | 5da74a4 | 2024-09-26 13:32:04 +0100 | [diff] [blame] | 35 | GIT_SHALLOW TRUE |
Kevin Peng | aa32cdf | 2023-09-11 10:38:22 +0800 | [diff] [blame] | 36 | GIT_PROGRESS TRUE |
| 37 | ) |