blob: dc059a35a7c5fd7506b6ac326c6ad7ced2b53040 [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#Include board specific config (CPU, etc...)
10include("Common/BoardSSE200")
11
12#Use any ARMCLANG version found on PATH. Note: Only versions supported by the
13#build system will work. A file cmake/Common/CompilerArmClangXY.cmake
14#must be present with a matching version.
15include("Common/FindArmClang")
16include("Common/${ARMCLANG_MODULE}")
17
18##These variables select how the projects are built. Each project will set
19#various project specific settings (e.g. what files to build, macro
20#definitions) based on these.
21set (REGRESSION False)
22set (CORE_TEST True)
23set (MCUBOOT False)
24
25##Shared compiler and linker settings.
26function(config_setting_shared_flags tgt)
27 embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS -xc -std=c99 -fshort-enums -mfpu=none -fshort-wchar -funsigned-char -mcmse -Wall -Werror)
28 embedded_set_target_link_flags(TARGET ${tgt} FLAGS --strict --map --symbols --xref --entry=Reset_Handler --info=summarysizes,sizes,totals,unused,veneers)
29endfunction()
30
31#Settings which shall be set for all projects the same way based
32# on the variables above.
33set (CORE_TEST_SERVICES False)
34set (CORE_TEST_POSITIVE False)
35set (CORE_TEST_INTERACTIVE False)
36
37if (REGRESSION)
38 set(SERVICES_TEST_ENABLED True)
39else()
40 set(SERVICES_TEST_ENABLED False)
41endif()
42
43if (SERVICES_TEST_ENABLED)
44 set(SERVICE_TEST_S on)
45 set(SERVICE_TEST_NS on)
46 set(CORE_TEST_POSITIVE on)
47 set(CORE_TEST_INTERACTIVE Off)
48endif()
49
50if (CORE_TEST)
51 set(CORE_TEST_POSITIVE on)
52 set(CORE_TEST_INTERACTIVE OFF)
53endif()
54
55if(CORE_TEST_INTERACTIVE)
56 add_definitions(-DCORE_TEST_INTERACTIVE)
57 set(TEST_FRAMEWORK_NS On)
58 set(CORE_TEST_SERVICES On)
59endif()
60
61if(CORE_TEST_POSITIVE)
62 add_definitions(-DCORE_TEST_POSITIVE)
63 set(TEST_FRAMEWORK_NS On)
64 set(CORE_TEST_SERVICES On)
65endif()
66
67if (SERVICE_TEST_S)
68 add_definitions(-DSERVICES_TEST_S)
69 set(TEST_FRAMEWORK_S On)
70endif()
71
72if (SERVICE_TEST_NS)
73 add_definitions(-DSERVICES_TEST_NS)
74 set(TEST_FRAMEWORK_NS On)
75endif()
76
77if(TEST_FRAMEWORK_S)
78 add_definitions(-DTEST_FRAMEWORK_S)
79endif()
80
81if(TEST_FRAMEWORK_NS)
82 add_definitions(-DTEST_FRAMEWORK_NS)
83endif()
84
85if (CORE_TEST_SERVICES)
86 add_definitions(-DCORE_TEST_SERVICES)
87endif()
88
89if (MCUBOOT)
90 add_definitions(-DMCUBOOT)
91endif()
92
93##Secure side
94config_setting_shared_flags(tfm_s)
95embedded_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")
96
97#Non secure side
98config_setting_shared_flags(tfm_ns)
99embedded_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")
100
101##TF-M storage
102config_setting_shared_flags(tfm_storage)
103set(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")
104
105set (SST_ENCRYPTION ON)
106set (SST_RAM_FS ON)
107set (SST_VALIDATE_METADATA_FROM_FLASH ON)
108set (ENABLE_SECURE_STORAGE ON)
109set (MBEDTLS_DEBUG ON)
110
111##Tests
112config_setting_shared_flags(tfm_secure_tests)
113config_setting_shared_flags(tfm_non_secure_tests)