QCBOR: rely on the upstream CMakeLists.txt
Change-Id: If2b6c27e89c163d6358492965e92104fc4ee8eae
Signed-off-by: David Vincze <david.vincze@arm.com>
diff --git a/lib/ext/qcbor/CMakeLists.txt b/lib/ext/qcbor/CMakeLists.txt
index 4eafd20..3dc3a3a 100644
--- a/lib/ext/qcbor/CMakeLists.txt
+++ b/lib/ext/qcbor/CMakeLists.txt
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
+# Copyright (c) 2020-2023, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -12,7 +12,13 @@
# Default configuration of QCBOR repository
set(QCBOR_PATH "DOWNLOAD" CACHE PATH "Path to qcbor (or DOWNLOAD to fetch automatically")
-set(QCBOR_VERSION "b0e70332" CACHE STRING "The version of qcbor to use")
+set(QCBOR_VERSION "92d3f890" CACHE STRING "The version of qcbor to use")
+
+# Entirely disable the floating-point support
+# in the qcbor library to reduce code size.
+set(QCBOR_OPT_DISABLE_FLOAT_HW_USE ON CACHE BOOL "Eliminate dependency on FP hardware and FP instructions" FORCE)
+set(QCBOR_OPT_DISABLE_FLOAT_PREFERRED ON CACHE BOOL "Eliminate support for half-precision and CBOR preferred serialization" FORCE)
+set(QCBOR_OPT_DISABLE_FLOAT_ALL ON CACHE BOOL "Eliminate floating-point support completely" FORCE)
if ("${QCBOR_PATH}" STREQUAL "DOWNLOAD")
FetchContent_Declare(qcbor
@@ -28,36 +34,16 @@
endif()
endif()
-add_library(tfm_qcbor_s STATIC EXCLUDE_FROM_ALL)
+add_subdirectory(${QCBOR_PATH} ${CMAKE_CURRENT_BINARY_DIR}/QCBOR)
-target_sources(tfm_qcbor_s
- PRIVATE
- ${QCBOR_PATH}/src/ieee754.c
- ${QCBOR_PATH}/src/qcbor_encode.c
- ${QCBOR_PATH}/src/qcbor_decode.c
- ${QCBOR_PATH}/src/UsefulBuf.c
-)
+set_target_properties(qcbor PROPERTIES EXCLUDE_FROM_ALL TRUE)
-target_compile_definitions(tfm_qcbor_s
- PRIVATE
- QCBOR_DISABLE_FLOAT_HW_USE
-)
-
-target_include_directories(tfm_qcbor_s
+target_compile_options(qcbor
PUBLIC
- $<BUILD_INTERFACE:${QCBOR_PATH}/inc>
+ ${COMPILER_CP_FLAG}
+)
+
+target_include_directories(qcbor
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
- $<BUILD_INTERFACE:${QCBOR_PATH}/inc/qcbor>
-)
-
-target_link_libraries(tfm_qcbor_s
- PRIVATE
- tfm_attestation_defs
- tfm_t_cose_defs
-)
-
-target_compile_options(tfm_qcbor_s
- PRIVATE
- ${COMPILER_CP_FLAG}
)
diff --git a/lib/ext/t_cose/CMakeLists.txt b/lib/ext/t_cose/CMakeLists.txt
index 586e7c6..3e2420a 100644
--- a/lib/ext/t_cose/CMakeLists.txt
+++ b/lib/ext/t_cose/CMakeLists.txt
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
+# Copyright (c) 2020-2023, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -54,8 +54,8 @@
PUBLIC
tfm_t_cose_common
tfm_t_cose_defs
- tfm_qcbor_s
psa_interface
+ qcbor
)
target_compile_options(tfm_t_cose_s
diff --git a/lib/ext/t_cose/inc/t_cose_mac0_sign.h b/lib/ext/t_cose/inc/t_cose_mac0_sign.h
index fa98210..40dfd16 100644
--- a/lib/ext/t_cose/inc/t_cose_mac0_sign.h
+++ b/lib/ext/t_cose/inc/t_cose_mac0_sign.h
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018-2019, Laurence Lundblade. All rights reserved.
- * Copyright (c) 2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -9,7 +9,7 @@
#define __T_COSE_MAC0_SIGN_H_
#include <stdint.h>
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
#include "t_cose_common.h"
#ifdef __cplusplus
diff --git a/lib/ext/t_cose/inc/t_cose_mac0_verify.h b/lib/ext/t_cose/inc/t_cose_mac0_verify.h
index 1b7c039..0d71e43 100644
--- a/lib/ext/t_cose/inc/t_cose_mac0_verify.h
+++ b/lib/ext/t_cose/inc/t_cose_mac0_verify.h
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2019, Laurence Lundblade. All rights reserved.
- * Copyright (c) 2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -9,7 +9,7 @@
#define __T_COSE_MAC0_VERIFY_H_
#include <stdint.h>
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
#include "t_cose_common.h"
#ifdef __cplusplus
diff --git a/lib/ext/t_cose/inc/t_cose_sign1_sign.h b/lib/ext/t_cose/inc/t_cose_sign1_sign.h
index 0dcf096..d8cbf0b 100644
--- a/lib/ext/t_cose/inc/t_cose_sign1_sign.h
+++ b/lib/ext/t_cose/inc/t_cose_sign1_sign.h
@@ -13,7 +13,7 @@
#include <stdint.h>
#include <stdbool.h>
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
#include "t_cose_common.h"
#ifdef __cplusplus
diff --git a/lib/ext/t_cose/src/t_cose_mac0_sign.c b/lib/ext/t_cose/src/t_cose_mac0_sign.c
index 4cd30e9..fffd262 100644
--- a/lib/ext/t_cose/src/t_cose_mac0_sign.c
+++ b/lib/ext/t_cose/src/t_cose_mac0_sign.c
@@ -1,13 +1,13 @@
/*
* Copyright (c) 2018-2019, Laurence Lundblade. All rights reserved.
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
* See BSD-3-Clause license in README.md
*/
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
#include "t_cose_crypto.h"
#include "t_cose_mac0_sign.h"
#include "t_cose_util.h"
diff --git a/lib/ext/t_cose/src/t_cose_mac0_verify.c b/lib/ext/t_cose/src/t_cose_mac0_verify.c
index b75cbda..fb5f633 100644
--- a/lib/ext/t_cose/src/t_cose_mac0_verify.c
+++ b/lib/ext/t_cose/src/t_cose_mac0_verify.c
@@ -1,13 +1,13 @@
/*
* Copyright (c) 2018-2019, Laurence Lundblade. All rights reserved.
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
* See BSD-3-Clause license in README.md
*/
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
#include "t_cose_crypto.h"
#include "t_cose_mac0_verify.h"
#include "t_cose_parameters.h"
diff --git a/lib/ext/t_cose/src/t_cose_parameters.h b/lib/ext/t_cose/src/t_cose_parameters.h
index b51e861..c594923 100644
--- a/lib/ext/t_cose/src/t_cose_parameters.h
+++ b/lib/ext/t_cose/src/t_cose_parameters.h
@@ -2,7 +2,7 @@
* t_cose_parameters.h
*
* Copyright 2019, Laurence Lundblade
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -16,7 +16,7 @@
#include "q_useful_buf.h"
#include "t_cose_common.h"
#include <stdint.h>
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
/**
diff --git a/lib/ext/t_cose/src/t_cose_sign1_sign.c b/lib/ext/t_cose/src/t_cose_sign1_sign.c
index 0169c83..de11a9a 100644
--- a/lib/ext/t_cose/src/t_cose_sign1_sign.c
+++ b/lib/ext/t_cose/src/t_cose_sign1_sign.c
@@ -9,7 +9,7 @@
*/
#include "t_cose_sign1_sign.h"
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
#include "t_cose_standard_constants.h"
#include "t_cose_crypto.h"
#include "t_cose_util.h"
@@ -464,4 +464,3 @@
Done:
return return_value;
}
-
diff --git a/lib/ext/t_cose/src/t_cose_sign1_verify.c b/lib/ext/t_cose/src/t_cose_sign1_verify.c
index 260aede..fb9d260 100644
--- a/lib/ext/t_cose/src/t_cose_sign1_verify.c
+++ b/lib/ext/t_cose/src/t_cose_sign1_verify.c
@@ -10,7 +10,7 @@
#include "t_cose_sign1_verify.h"
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
#include "t_cose_crypto.h"
#include "q_useful_buf.h"
#include "t_cose_util.h"
diff --git a/lib/ext/t_cose/src/t_cose_util.c b/lib/ext/t_cose/src/t_cose_util.c
index b6c9f11..f6dacee 100644
--- a/lib/ext/t_cose/src/t_cose_util.c
+++ b/lib/ext/t_cose/src/t_cose_util.c
@@ -2,7 +2,7 @@
* t_cose_util.c
*
* Copyright 2019, Laurence Lundblade
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -10,7 +10,7 @@
*/
#include "t_cose_util.h"
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
#include "t_cose_standard_constants.h"
#include "t_cose_common.h"
#include "t_cose_crypto.h"
diff --git a/lib/ext/t_cose/test/t_cose_make_test_messages.c b/lib/ext/t_cose/test/t_cose_make_test_messages.c
index 9293b63..89bb784 100644
--- a/lib/ext/t_cose/test/t_cose_make_test_messages.c
+++ b/lib/ext/t_cose/test/t_cose_make_test_messages.c
@@ -9,7 +9,7 @@
*/
#include "t_cose_make_test_messages.h"
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
#include "t_cose_crypto.h"
#include "t_cose_util.h"
@@ -605,4 +605,3 @@
Done:
return return_value;
}
-
diff --git a/lib/ext/t_cose/test/t_cose_make_test_messages.h b/lib/ext/t_cose/test/t_cose_make_test_messages.h
index d1babce..f959ca9 100644
--- a/lib/ext/t_cose/test/t_cose_make_test_messages.h
+++ b/lib/ext/t_cose/test/t_cose_make_test_messages.h
@@ -14,7 +14,7 @@
#include <stdint.h>
#include <stdbool.h>
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
#include "t_cose_common.h"
#include "t_cose_sign1_sign.h"
diff --git a/lib/ext/tf-m-tests/repo_config_default.cmake b/lib/ext/tf-m-tests/repo_config_default.cmake
index 418ea12..7110be9 100644
--- a/lib/ext/tf-m-tests/repo_config_default.cmake
+++ b/lib/ext/tf-m-tests/repo_config_default.cmake
@@ -10,5 +10,5 @@
# Default configs of tf-m-tests repo
set(TFM_TEST_REPO_PATH "DOWNLOAD" CACHE PATH "Path to TFM-TEST repo (or DOWNLOAD to fetch automatically")
-set(TFM_TEST_REPO_VERSION "5e0027d7" CACHE STRING "The version of tf-m-tests to use")
+set(TFM_TEST_REPO_VERSION "66e119aa" CACHE STRING "The version of tf-m-tests to use")
set(CMSIS_5_PATH "DOWNLOAD" CACHE PATH "Path to CMSIS_5 (or DOWNLOAD to fetch automatically")