blob: 09958d19bbf880a690200275b7bcf668b9851389 [file] [log] [blame]
Gyorgy Szing30fa9872017-12-05 01:08:47 +00001#-------------------------------------------------------------------------------
2# Copyright (c) 2017, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8#This file holds information of a specific build configuration of this project.
9#Process this file only once.
10#if(DEFINED EMBEDDED_PROJ_CONFIG_LOADED)
11# return()
12#endif()
13#set(EMBEDDED_PROJ_CONFIG_LOADED True)
14
15#Include board specific config (CPU, etc...)
16include("Common/BoardSSE200")
17
18#Use any ARMCLANG version found on PATH. Note: Only versions supported by the
19#build system will work. A file cmake/Common/CompilerArmClangXY.cmake
20#must be present with a matching version.
21include("Common/FindArmClang")
22include("Common/${ARMCLANG_MODULE}")
23
24##These variables select how the projects are built. Each project will set
25#various project specific settings (e.g. what files to build, macro
26#definitions) based on these.
27set (REGRESSION True)
28set (CORE_TEST False)
29set (MCUBOOT False)
30
31##Shared compiler and linker settings.
32function(config_setting_shared_flags tgt)
33 embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS -xc -std=c99 -fshort-enums -mfpu=none -fshort-wchar -funsigned-char -mcmse -Wall -Werror)
34 embedded_set_target_link_flags(TARGET ${tgt} FLAGS --strict --map --symbols --xref --entry=Reset_Handler --info=summarysizes,sizes,totals,unused,veneers)
35endfunction()
36
37#Settings which shall be set for all projects the same way based
38# on the variables above.
39set (CORE_TEST_SERVICES False)
40set (CORE_TEST_POSITIVE False)
41set (CORE_TEST_INTERACTIVE False)
42if (REGRESSION)
43 set(SERVICES_TEST_ENABLED True)
44else()
45 set(SERVICES_TEST_ENABLED False)
46endif()
47
48if (SERVICES_TEST_ENABLED)
49 set(SERVICE_TEST_S on)
50 set(SERVICE_TEST_NS on)
51 set(CORE_TEST_POSITIVE on)
52 set(CORE_TEST_INTERACTIVE Off)
53endif()
54
55if (CORE_TEST)
56 set(CORE_TEST_POSITIVE on)
57 set(CORE_TEST_INTERACTIVE OFF)
58endif()
59
60if(CORE_TEST_INTERACTIVE)
61 add_definitions(-DCORE_TEST_INTERACTIVE)
62 set(TEST_FRAMEWORK_NS On)
63 set(CORE_TEST_SERVICES On)
64endif()
65
66if(CORE_TEST_POSITIVE)
67 add_definitions(-DCORE_TEST_POSITIVE)
68 set(TEST_FRAMEWORK_NS On)
69 set(CORE_TEST_SERVICES On)
70endif()
71
72if (SERVICE_TEST_S)
73 add_definitions(-DSERVICES_TEST_S)
74 set(TEST_FRAMEWORK_S On)
75endif()
76
77if (SERVICE_TEST_NS)
78 add_definitions(-DSERVICES_TEST_NS)
79 set(TEST_FRAMEWORK_NS On)
80endif()
81
82if(TEST_FRAMEWORK_S)
83 add_definitions(-DTEST_FRAMEWORK_S)
84endif()
85
86if(TEST_FRAMEWORK_NS)
87 add_definitions(-DTEST_FRAMEWORK_NS)
88endif()
89
90if (CORE_TEST_SERVICES)
91 add_definitions(-DCORE_TEST_SERVICES)
92endif()
93
94if (MCUBOOT)
95 add_definitions(-DMCUBOOT)
96endif()
97
98##Secure side
99config_setting_shared_flags(tfm_s)
100embedded_set_target_linker_file(TARGET tfm_s PATH "${CMAKE_CURRENT_LIST_DIR}/platform/ext/target/sse_200_mps2/sse_200/armclang/sse_200_s.sct")
101
102#Non secure side
103config_setting_shared_flags(tfm_ns)
104embedded_set_target_linker_file(TARGET tfm_ns PATH "${CMAKE_CURRENT_LIST_DIR}/platform/ext/target/sse_200_mps2/sse_200/armclang/sse_200_ns.sct")
105
106##TF-M storage
107config_setting_shared_flags(tfm_storage)
108set(MBEDTLS_C_FLAGS "-D__ARM_FEATURE_CMSE=3 -D__thumb2__ -fshort-enums -mfpu=none -fshort-wchar -funsigned-char -mcmse -DMBEDTLS_CONFIG_FILE=\\\\\\\"mbedtls_config.h\\\\\\\" -I${CMAKE_CURRENT_LIST_DIR}/platform/ext/target/common")
109
110set (SST_ENCRYPTION ON)
111set (SST_RAM_FS ON)
112set (SST_VALIDATE_METADATA_FROM_FLASH ON)
113set (ENABLE_SECURE_STORAGE ON)
114set (MBEDTLS_DEBUG ON)
115
116##Tests
117config_setting_shared_flags(tfm_secure_tests)
118config_setting_shared_flags(tfm_non_secure_tests)