Attest: Remove test code from release build
Due to code size optimization reasons the test code is
removed from the TF-M release build. Some attestation test
cases (short-circuit signature, get minimal token, passing
option fields to attestation service) only available in
debug builds.
Change-Id: I17f44604bbd30b1d9098a7f6d13a1ca21d5c80ae
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index 15635e1..eff3005 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -343,6 +343,12 @@
set(ATTEST_INCLUDE_OPTIONAL_CLAIMS ON)
endif()
+if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(ATTEST_INCLUDE_TEST_CODE_AND_KEY_ID ON)
+else()
+ set(ATTEST_INCLUDE_TEST_CODE_AND_KEY_ID OFF)
+endif()
+
##Set mbedTLS compiler flags for BL2 bootloader
set(MBEDTLS_C_FLAGS_BL2 "-D__ARM_FEATURE_CMSE=${ARM_FEATURE_CMSE} -D__thumb2__ ${COMMON_COMPILE_FLAGS_STR} -DMBEDTLS_CONFIG_FILE=\\\\\\\"config-boot.h\\\\\\\" -I${CMAKE_CURRENT_LIST_DIR}/bl2/ext/mcuboot/include")
if (MCUBOOT_SIGNATURE_TYPE STREQUAL "RSA-3072")