blob: eff30053671a4b401fd5ddbe81bbe9e7fb660761 [file] [log] [blame]
Mate Toth-Pal65c935e2018-01-17 18:42:13 +01001#-------------------------------------------------------------------------------
Jamie Fox17c30bb2019-01-10 13:39:33 +00002# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
Mate Toth-Pal65c935e2018-01-17 18:42:13 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8if(NOT DEFINED REGRESSION)
9 message(FATAL_ERROR "ERROR: Incomplete Configuration: REGRESSION not defined, Include this file from a Config*.cmake")
10elseif(NOT DEFINED CORE_TEST)
11 message(FATAL_ERROR "ERROR: Incomplete Configuration: CORE_TEST not defined, Include this file from a Config*.cmake")
Tamas Band90c81b2018-08-15 15:03:42 +010012elseif(NOT DEFINED TFM_LVL)
13 message(FATAL_ERROR "ERROR: Incomplete Configuration: TFM_LVL not defined, Include this file from a Config*.cmake")
David Huf2cfa122019-08-27 15:32:38 +080014elseif(NOT DEFINED CORE_IPC)
15 message(FATAL_ERROR "ERROR: Incomplete Configuration: CORE_IPC not deinfed. Include this file from a Config*.cmake")
Mate Toth-Pal65c935e2018-01-17 18:42:13 +010016endif()
17
Mate Toth-Palee551bc2018-06-12 16:40:45 +020018if(NOT DEFINED COMPILER)
19 message(FATAL_ERROR "ERROR: COMPILER is not set in command line")
20elseif((NOT ${COMPILER} STREQUAL "ARMCLANG") AND (NOT ${COMPILER} STREQUAL "GNUARM"))
21 message(FATAL_ERROR "ERROR: Compiler \"${COMPILER}\" is not supported.")
22endif()
23
Tamas Bandd10fe52019-09-18 11:52:32 +010024#Configure the default build type
25set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (i.e. Debug)")
26
Edison Aicb0ecf62019-07-10 18:43:51 +080027if(CORE_IPC)
28 if (TFM_LVL EQUAL 3)
29 message(FATAL_ERROR "ERROR: Invalid isolation level!")
30 endif()
31else()
32 if(NOT TFM_LVL EQUAL 1)
33 message(FATAL_ERROR "ERROR: Invalid isolation level!")
34 endif()
35endif()
36
David Vincze4638b2a2019-05-24 10:14:23 +020037#BL2 bootloader (MCUBoot) related settings
David Vincze54d05552019-08-05 12:58:47 +020038include(${CMAKE_CURRENT_LIST_DIR}/bl2/ext/mcuboot/MCUBootConfig.cmake)
David Vincze4638b2a2019-05-24 10:14:23 +020039
Mate Toth-Pal48fc6a02018-01-24 09:50:14 +010040set(BUILD_CMSIS_CORE Off)
41set(BUILD_RETARGET Off)
42set(BUILD_NATIVE_DRIVERS Off)
43set(BUILD_TIME Off)
44set(BUILD_STARTUP Off)
45set(BUILD_TARGET_CFG Off)
46set(BUILD_TARGET_HARDWARE_KEYS Off)
Marc Moreno Berengue4cc81fc2018-08-10 14:32:01 +010047set(BUILD_TARGET_NV_COUNTERS Off)
Mate Toth-Pal48fc6a02018-01-24 09:50:14 +010048set(BUILD_CMSIS_DRIVERS Off)
49set(BUILD_UART_STDOUT Off)
50set(BUILD_FLASH Off)
Tamas Ban3681ce02018-11-22 15:19:24 +000051set(BUILD_BOOT_SEED Off)
Tamas Ban38e17312018-11-22 15:26:35 +000052set(BUILD_DEVICE_ID Off)
Mate Toth-Pald3c77662019-02-20 16:23:00 +010053set(BUILD_PLAT_TEST Off)
Mate Toth-Pal48fc6a02018-01-24 09:50:14 +010054if(NOT DEFINED PLATFORM_CMAKE_FILE)
55 message (FATAL_ERROR "Platform specific CMake is not defined. Please set PLATFORM_CMAKE_FILE.")
56elseif(NOT EXISTS ${PLATFORM_CMAKE_FILE})
57 message (FATAL_ERROR "Platform specific CMake \"${PLATFORM_CMAKE_FILE}\" file does not exist. Please fix value of PLATFORM_CMAKE_FILE.")
58else()
59 include(${PLATFORM_CMAKE_FILE})
60endif()
61
David Hu857bfa52019-05-21 13:54:50 +080062# Select the corresponding CPU type and configuration according to current
63# building status in multi-core scenario.
64# The updated configuration will be used in following compiler setting.
65if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY)
66 include("Common/MultiCore")
67
68 if (NOT DEFINED TFM_BUILD_IN_SPE)
69 message(FATAL_ERROR "Flag of building in SPE is not specified. Please set TFM_BUILD_IN_SPE.")
70 else()
71 select_arm_cpu_type(${TFM_BUILD_IN_SPE})
72 endif()
73endif()
74
David Hufeae0f92019-06-17 13:42:20 +080075if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY)
76 # CMSE is unnecessary in multi-core scenarios.
77 # TODO: Need further discussion about if CMSE is required when an Armv8-M
78 # core acts as secure core in multi-core scenario.
79 set (CMSE_FLAGS "")
80 set (ARM_FEATURE_CMSE 0)
81else()
82 set (CMSE_FLAGS "-mcmse")
83 set (ARM_FEATURE_CMSE 3)
84endif()
85
Mate Toth-Palee551bc2018-06-12 16:40:45 +020086if(${COMPILER} STREQUAL "ARMCLANG")
Mate Toth-Pal76867262018-03-09 13:15:36 +010087 #Use any ARMCLANG version found on PATH. Note: Only versions supported by the
88 #build system will work. A file cmake/Common/CompilerArmClangXY.cmake
89 #must be present with a matching version.
90 include("Common/FindArmClang")
91 include("Common/${ARMCLANG_MODULE}")
Mate Toth-Pal48fc6a02018-01-24 09:50:14 +010092
David Hufeae0f92019-06-17 13:42:20 +080093 set (COMMON_COMPILE_FLAGS -fshort-enums -fshort-wchar -funsigned-char -mfpu=none ${CMSE_FLAGS} -ffunction-sections -fdata-sections)
Tamas Bandb69d522018-03-01 10:04:41 +000094 ##Shared compiler settings.
95 function(config_setting_shared_compiler_flags tgt)
Mate Toth-Pal76867262018-03-09 13:15:36 +010096 embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS -xc -std=c99 ${COMMON_COMPILE_FLAGS} -Wall -Werror)
Tamas Bandb69d522018-03-01 10:04:41 +000097 endfunction()
98
99 ##Shared linker settings.
100 function(config_setting_shared_linker_flags tgt)
Antonio de Angelis3302f452019-07-19 10:36:33 +0100101 embedded_set_target_link_flags(TARGET ${tgt} FLAGS --strict --map --symbols --xref --entry=Reset_Handler --remove --info=summarysizes,sizes,totals,unused,veneers)
Mate Toth-Pal76867262018-03-09 13:15:36 +0100102 endfunction()
103elseif(${COMPILER} STREQUAL "GNUARM")
104 #Use any GNUARM version found on PATH. Note: Only versions supported by the
105 #build system will work. A file cmake/Common/CompilerGNUARMXY.cmake
106 #must be present with a matching version.
107 include("Common/FindGNUARM")
108 include("Common/${GNUARM_MODULE}")
Mate Toth-Pal48fc6a02018-01-24 09:50:14 +0100109
David Hufeae0f92019-06-17 13:42:20 +0800110 set (COMMON_COMPILE_FLAGS -fshort-enums -fshort-wchar -funsigned-char -msoft-float ${CMSE_FLAGS} -ffunction-sections -fdata-sections --specs=nano.specs)
Mate Toth-Pal76867262018-03-09 13:15:36 +0100111 ##Shared compiler and linker settings.
Tamas Bandb69d522018-03-01 10:04:41 +0000112 function(config_setting_shared_compiler_flags tgt)
Mate Toth-Pal76867262018-03-09 13:15:36 +0100113 embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS -xc -std=c99 ${COMMON_COMPILE_FLAGS} -Wall -Werror -Wno-format -Wno-return-type -Wno-unused-but-set-variable)
Tamas Bandb69d522018-03-01 10:04:41 +0000114 endfunction()
115
116 ##Shared linker settings.
117 function(config_setting_shared_linker_flags tgt)
Mate Toth-Pal76867262018-03-09 13:15:36 +0100118 #--no-wchar-size-warning flag is added because TF-M sources are compiled
119 #with short wchars, however the standard library is compiled with normal
120 #wchar, and this generates linker time warnings. TF-M code does not use
121 #wchar, so the warning can be suppressed.
Antonio de Angelis3302f452019-07-19 10:36:33 +0100122 embedded_set_target_link_flags(TARGET ${tgt} FLAGS -Wl,-check-sections,-fatal-warnings,--gc-sections,--no-wchar-size-warning,--print-memory-usage --entry=Reset_Handler --specs=nano.specs)
Mate Toth-Pal76867262018-03-09 13:15:36 +0100123 endfunction()
Mate Toth-Pal76867262018-03-09 13:15:36 +0100124endif()
125
126#Create a string from the compile flags list, so that it can be used later
127#in this file to set mbedtls and BL2 flags
Tamas Bandb69d522018-03-01 10:04:41 +0000128list_to_string(COMMON_COMPILE_FLAGS_STR ${COMMON_COMPILE_FLAGS})
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100129
130#Settings which shall be set for all projects the same way based
131# on the variables above.
Mate Toth-Pal349714a2018-02-23 15:30:24 +0100132set (TFM_PARTITION_TEST_CORE OFF)
Jamie Foxadf02552019-05-16 17:44:52 +0100133set (TFM_PARTITION_TEST_CORE_IPC OFF)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100134set (CORE_TEST_POSITIVE OFF)
135set (CORE_TEST_INTERACTIVE OFF)
Miklos Balintf13ec022018-04-06 17:21:22 +0200136set (REFERENCE_PLATFORM OFF)
Ben Davis6d7256b2018-04-18 14:16:53 +0100137set (TFM_PARTITION_TEST_SECURE_SERVICES OFF)
Tamas Band90c81b2018-08-15 15:03:42 +0100138set (SERVICES_TEST_ENABLED OFF)
Marc Moreno Berenguecae2c532018-10-09 12:58:46 +0100139set (TEST_FRAMEWORK_S OFF)
140set (TEST_FRAMEWORK_NS OFF)
Edison Aiec109cd2018-07-17 16:04:14 +0800141set (TFM_PSA_API OFF)
Miklos Balint87da2512018-04-19 13:45:50 +0200142set (TFM_LEGACY_API ON)
Miklos Balintf13ec022018-04-06 17:21:22 +0200143
Jamie Foxc78c62c2019-05-23 13:42:17 +0100144option(TFM_PARTITION_AUDIT_LOG "Enable the TF-M Audit Log partition" ON)
Mingyang Sun9511e5e2019-05-29 18:18:44 +0800145option(TFM_PARTITION_PLATFORM "Enable the TF-M Platform partition" ON)
Jamie Foxc78c62c2019-05-23 13:42:17 +0100146
Marton Berke6fd21f12019-07-02 13:43:07 +0200147if(${TARGET_PLATFORM} STREQUAL "AN521" OR ${TARGET_PLATFORM} STREQUAL "AN519" OR ${TARGET_PLATFORM} STREQUAL "AN539")
Miklos Balintf13ec022018-04-06 17:21:22 +0200148 set (REFERENCE_PLATFORM ON)
149endif()
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100150
Miklos Balint6cbeba62018-04-12 17:31:34 +0200151# Option to demonstrate usage of secure-only peripheral
152set (SECURE_UART1 OFF)
153
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100154if (REGRESSION)
155 set(SERVICES_TEST_ENABLED ON)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100156endif()
157
Edison Aiec109cd2018-07-17 16:04:14 +0800158if (CORE_IPC)
159 set(TFM_PSA_API ON)
David Huf2cfa122019-08-27 15:32:38 +0800160
161 # Disable IPC Test by default if the config or platform doesn't explicitly
162 # require it
163 if (NOT DEFINED IPC_TEST)
164 set(IPC_TEST OFF)
165 endif()
166else()
167 set(IPC_TEST OFF)
Edison Aiec109cd2018-07-17 16:04:14 +0800168endif()
169
Miklos Balint87da2512018-04-19 13:45:50 +0200170if (TFM_PSA_API)
171 add_definitions(-DTFM_PSA_API)
172endif()
173
174if (TFM_LEGACY_API)
175 add_definitions(-DTFM_LEGACY_API)
176endif()
177
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100178if (SERVICES_TEST_ENABLED)
179 set(SERVICE_TEST_S ON)
180 set(SERVICE_TEST_NS ON)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100181endif()
182
183if (CORE_TEST)
Mate Toth-Pal6569a592019-06-07 12:09:50 +0200184 set(CORE_TEST_POSITIVE ON)
185 set(CORE_TEST_INTERACTIVE OFF)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100186endif()
187
Ben Davis6d7256b2018-04-18 14:16:53 +0100188if (CORE_TEST_INTERACTIVE)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100189 add_definitions(-DCORE_TEST_INTERACTIVE)
190 set(TEST_FRAMEWORK_NS ON)
Mate Toth-Pal349714a2018-02-23 15:30:24 +0100191 set(TFM_PARTITION_TEST_CORE ON)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100192endif()
193
Ben Davis6d7256b2018-04-18 14:16:53 +0100194if (CORE_TEST_POSITIVE)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100195 add_definitions(-DCORE_TEST_POSITIVE)
196 set(TEST_FRAMEWORK_NS ON)
Mate Toth-Pal349714a2018-02-23 15:30:24 +0100197 set(TFM_PARTITION_TEST_CORE ON)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100198endif()
199
David Hu33f2fd22019-08-16 15:32:39 +0800200if (TFM_PARTITION_TEST_CORE)
201 # If the platform or the topology doesn't specify whether IRQ test is
202 # supported, enable it by default.
203 if (NOT DEFINED TFM_ENABLE_IRQ_TEST)
204 set(TFM_ENABLE_IRQ_TEST ON)
205 endif()
206
207 if (TFM_ENABLE_IRQ_TEST)
208 add_definitions(-DTFM_ENABLE_IRQ_TEST)
209 endif()
210else()
211 set(TFM_ENABLE_IRQ_TEST OFF)
212endif()
213
David Huf2cfa122019-08-27 15:32:38 +0800214if (IPC_TEST)
215 add_definitions(-DENABLE_IPC_TEST)
Jamie Foxadf02552019-05-16 17:44:52 +0100216 set(TEST_FRAMEWORK_NS ON)
217 set(TFM_PARTITION_TEST_CORE_IPC ON)
Edison Aiec109cd2018-07-17 16:04:14 +0800218endif()
219
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100220if (SERVICE_TEST_S)
221 add_definitions(-DSERVICES_TEST_S)
222 set(TEST_FRAMEWORK_S ON)
223endif()
224
225if (SERVICE_TEST_NS)
226 add_definitions(-DSERVICES_TEST_NS)
227 set(TEST_FRAMEWORK_NS ON)
228endif()
229
Ben Davis6d7256b2018-04-18 14:16:53 +0100230if (TEST_FRAMEWORK_S)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100231 add_definitions(-DTEST_FRAMEWORK_S)
Jamie Fox56da0992019-05-28 14:35:06 +0100232 # The secure client partition is required to run secure tests
233 set(TFM_PARTITION_TEST_SECURE_SERVICES ON)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100234endif()
235
Ben Davis6d7256b2018-04-18 14:16:53 +0100236if (TEST_FRAMEWORK_NS)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100237 add_definitions(-DTEST_FRAMEWORK_NS)
238endif()
239
Jamie Foxc78c62c2019-05-23 13:42:17 +0100240if (CORE_IPC)
241 set(TFM_PARTITION_AUDIT_LOG OFF)
Mingyang Sun9511e5e2019-05-29 18:18:44 +0800242 set(TFM_PARTITION_PLATFORM OFF)
Jamie Foxc78c62c2019-05-23 13:42:17 +0100243endif()
244
245if (TFM_PARTITION_AUDIT_LOG)
246 add_definitions(-DTFM_PARTITION_AUDIT_LOG)
247endif()
248
Mingyang Sun9511e5e2019-05-29 18:18:44 +0800249if (TFM_PARTITION_PLATFORM)
250 add_definitions(-DTFM_PARTITION_PLATFORM)
251endif()
252
Mate Toth-Pal349714a2018-02-23 15:30:24 +0100253if (TFM_PARTITION_TEST_CORE)
254 add_definitions(-DTFM_PARTITION_TEST_CORE)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100255endif()
256
Jamie Foxadf02552019-05-16 17:44:52 +0100257if (TFM_PARTITION_TEST_CORE_IPC)
258 add_definitions(-DTFM_PARTITION_TEST_CORE_IPC)
259endif()
260
Jamie Foxc78c62c2019-05-23 13:42:17 +0100261if (TFM_PARTITION_TEST_SECURE_SERVICES)
262 add_definitions(-DTFM_PARTITION_TEST_SECURE_SERVICES)
263endif()
264
Jamie Fox17c30bb2019-01-10 13:39:33 +0000265if (PSA_API_TEST)
266 add_definitions(-DPSA_API_TEST_NS)
267 set(PSA_API_TEST_NS ON)
268 if (NOT DEFINED PSA_API_TEST_CRYPTO)
269 set(PSA_API_TEST_CRYPTO OFF)
270 endif()
271 if (NOT DEFINED PSA_API_TEST_SECURE_STORAGE)
272 set(PSA_API_TEST_SECURE_STORAGE OFF)
273 endif()
274 if (NOT DEFINED PSA_API_TEST_ATTESTATION)
275 set(PSA_API_TEST_ATTESTATION OFF)
276 endif()
277endif()
278
Marc Moreno Berenguec2e4db82018-09-14 16:32:24 +0100279# This flag indicates if the non-secure OS is capable of identify the non-secure clients
Mingyang Sun9ac02372019-08-26 15:59:14 +0800280# which call the secure services. It is diabled in IPC model.
Marc Moreno Berenguec2e4db82018-09-14 16:32:24 +0100281if (NOT DEFINED TFM_NS_CLIENT_IDENTIFICATION)
Mingyang Sun9ac02372019-08-26 15:59:14 +0800282 if (TFM_PSA_API)
283 set(TFM_NS_CLIENT_IDENTIFICATION OFF)
284 else()
285 set(TFM_NS_CLIENT_IDENTIFICATION ON)
286 endif()
Marc Moreno Berenguec2e4db82018-09-14 16:32:24 +0100287endif()
288
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100289if (BL2)
David Vincze63eda7a2019-08-09 17:42:51 +0200290 # Add MCUBOOT_IMAGE_NUMBER definition to the compiler command line.
291 add_definitions(-DMCUBOOT_IMAGE_NUMBER=${MCUBOOT_IMAGE_NUMBER})
292
David Vincze4638b2a2019-05-24 10:14:23 +0200293 if (${MCUBOOT_UPGRADE_STRATEGY} STREQUAL "NO_SWAP")
Tamas Bandb69d522018-03-01 10:04:41 +0000294 set(LINK_TO_BOTH_MEMORY_REGION ON)
295 endif()
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100296endif()
297
Jamie Foxdaade492019-04-26 14:35:39 +0100298##Set Mbed TLS compiler flags and variables for audit log and crypto
David Hufeae0f92019-06-17 13:42:20 +0800299set(MBEDTLS_C_FLAGS_SERVICES "-D__ARM_FEATURE_CMSE=${ARM_FEATURE_CMSE} -D__thumb2__ ${COMMON_COMPILE_FLAGS_STR} -I${CMAKE_CURRENT_LIST_DIR}/platform/ext/common")
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100300
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000301#Default TF-M secure storage flags.
302#These flags values can be overwritten by setting them in platform/ext/<TARGET_NAME>.cmake
Tamas Ban01f64c52019-08-26 13:46:21 +0100303#Documentation about these flags can be found in docs/user_guides/services/tfm_sst_integration_guide.rst
Marc Moreno Berengue8385e8e2019-01-21 11:49:50 +0000304if (NOT DEFINED SST_ENCRYPTION)
305 set (SST_ENCRYPTION ON)
306endif()
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000307
Marc Moreno Berengue8385e8e2019-01-21 11:49:50 +0000308if (NOT DEFINED SST_ROLLBACK_PROTECTION)
309 set (SST_ROLLBACK_PROTECTION OFF)
310endif()
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000311
Marc Moreno Berengue8385e8e2019-01-21 11:49:50 +0000312if (NOT DEFINED SST_CREATE_FLASH_LAYOUT)
313 set (SST_CREATE_FLASH_LAYOUT OFF)
314endif()
Marc Moreno Berengue184d2032018-08-14 12:51:43 +0100315
Marc Moreno Berengue8385e8e2019-01-21 11:49:50 +0000316if (NOT DEFINED SST_VALIDATE_METADATA_FROM_FLASH)
317 set (SST_VALIDATE_METADATA_FROM_FLASH ON)
318endif()
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000319
Marc Moreno Berengue8385e8e2019-01-21 11:49:50 +0000320if (NOT DEFINED SST_RAM_FS)
321 if (REGRESSION)
322 set (SST_RAM_FS ON)
323 else()
324 set (SST_RAM_FS OFF)
Marc Moreno Berengue02a23442018-08-15 14:28:45 +0100325 endif()
Marc Moreno Berengue792fc682018-02-20 11:53:30 +0000326endif()
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000327
Jamie Fox95bacd42019-03-21 18:14:15 +0000328if (NOT DEFINED SST_TEST_NV_COUNTERS)
329 if (REGRESSION AND (TFM_LVL EQUAL 1))
330 set(SST_TEST_NV_COUNTERS ON)
331 else()
332 set(SST_TEST_NV_COUNTERS OFF)
333 endif()
334endif()
335
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000336if (NOT DEFINED MBEDTLS_DEBUG)
Jamie Fox287885f2018-10-24 14:09:34 +0100337 set(MBEDTLS_DEBUG OFF)
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000338endif()
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100339
Tamas Ban01f64c52019-08-26 13:46:21 +0100340#Default TF-M initial-attestation service flags.
341#Documentation about these flags can be found in docs/user_guides/services/tfm_attestation_integration_guide.rst
342if (NOT DEFINED ATTEST_INCLUDE_OPTIONAL_CLAIMS)
343 set(ATTEST_INCLUDE_OPTIONAL_CLAIMS ON)
344endif()
345
Tamas Ban303dd082019-08-27 10:43:03 +0100346if (CMAKE_BUILD_TYPE STREQUAL "Debug")
347 set(ATTEST_INCLUDE_TEST_CODE_AND_KEY_ID ON)
348else()
349 set(ATTEST_INCLUDE_TEST_CODE_AND_KEY_ID OFF)
350endif()
351
Tamas Bandb69d522018-03-01 10:04:41 +0000352##Set mbedTLS compiler flags for BL2 bootloader
David Hufeae0f92019-06-17 13:42:20 +0800353set(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")
Tamas Ban7801ed42019-05-20 13:21:53 +0100354if (MCUBOOT_SIGNATURE_TYPE STREQUAL "RSA-3072")
355 string(APPEND MBEDTLS_C_FLAGS_BL2 " -DMCUBOOT_SIGN_RSA_LEN=3072")
Jamie Foxc78c62c2019-05-23 13:42:17 +0100356endif()